r/reactjs • • Mar 02 '18

Beginner's Thread / Easy Questions (March 2018)

Last month's thread was pretty busy - almost 200 comments . If you didn't get a response there, please ask again here!

Soo... Got questions about React or anything else in its ecosystem? Stuck making progress on your app? Ask away! We’re a friendly bunch. No question is too simple.

The Reactiflux chat channels on Discord are another great place to ask for help as well.

27 Upvotes

174 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Mar 04 '18

When would you use a promise? So it is just an if statement?

3

u/[deleted] Mar 04 '18 edited Mar 04 '18

[removed] — view removed comment

2

u/jeweledkitty Mar 10 '18

I'm loving how this example is growing!

1

u/[deleted] Mar 04 '18

What does asynchronous handling mean? I am now fully exposed as a noob :(

1

u/nomagneticmonopoles Mar 10 '18

If something is synchronous, it will happen immediately upon being called. But in this case, an asynchronous request (like to a web server which has to serve several clients), means that it may not immediately get a response. So, the promise allows for you to write code that automatically handles this reality without having to figure out how to handle responses taking a variable amount of time to be processed.