Confused about async?

Asynchrony is synonym of(out of order). The concept of async in node, when the script is not blocked, for example when loading data, ie the script is not waiting for the download, and processes in the background,and the code is processed further, but on the client, on the contrary, if the situation with promises, each call chain function waiting for each other, i.e. serially.
In redux, in the asynchronous action method dispatch, not redrawn, it will render until you load the api(that is, asynchronously, has the opposite meaning). Who will help to sort out this mess, thanks.
June 26th 19 at 14:26
1 answer
June 26th 19 at 14:28
Solution
but on the client, on the contrary, if the situation with promises, each call chain function waiting for each other, i.e. serially.


This is not true. The chain is not waiting for each other - the thread is not blocked, as well as the node. When it comes to the response server calls appropriate callback. But while waiting - your code works (for instance you wanted to render the loading animation).

In the asynchronous action you can change state (to dispatchit) when you wish. This is usually done twice - when the request is sent (initiated) and when the answer came. Between these moments you may have other action (user pressed a button or something else happened) and you also handle them asynchronously.
Well. Whether it is the case when asynchronous processing, for example getting json'a file failing to load, begins to be fulfilled? and he is still not loaded... That is non-blocking script, downloadable it, but already processed the callback function. - Nicole_Thi commented on June 26th 19 at 14:31
: um, no, not there. He is with you is treated as
fetch('myJson.json').then(response => ...)

But the script is not locked - rhett.Bayer commented on June 26th 19 at 14:34
: we share performance as atwhen the data is ready. If data is not ready, and the execution of promise chains continued - then it is bad code, not asiannet. But theoretically, it could be. But the point then? - blake_Eichma commented on June 26th 19 at 14:37
I'm still a greenhorn). As I understand it, the promis and its chains of asynchronous, but the transfer of data and logic between the chains synchronously, right? Then one works and the other is waiting. Noda mastered a little more complicated than the client... But still being developed:) - Nicole_Thi commented on June 26th 19 at 14:40
: promises can be in the front - blake_Eichma commented on June 26th 19 at 14:43

Find more questions by tags Node.jsReduxReactAsynchronous programming