- If we ponder more on asynchronous requests, they are requests made from our web page to some activity which is going to take it’s own time to respond.
- After mounting the described UI to the DOM, it goes ahead and asks the free willed activity : — -Requesting the Free Willed ActivityAnd meanwhile our free willed activity is likeUnfortunately, our highly energetic react component will have to depend on promises.
- Each of those nodes when clicked can produce more nodes by fetching more data from server.Package dependenciesNow our new componentSo handleNodeClick is the method which is invoked every time a node is clicked in the Network component.We have defined the function to be asynchronous by adding the keyword async before the function definition.
- The keyword await is used to wait for the activity which here is a promise of fetching data from remote server.
- The function is asynchronous and it waits for a promise to complete and then continues with normal execution.
Magic is what Async/Await bring to the table for handling asynchronous requests. If we ponder more on asynchronous requests, they are requests made from our web page to some activity which is going…
Continue reading “Async/Await into React…… – codeburst”