Thursday, February 22, 2018

Why do we need middleware for async flow in Redux?



According to the docs, "Without middleware, Redux store only supports synchronous data flow". I don't understand why this is the case. Why can't the container component call the async API, and then dispatch the actions? For example, imagine a simple UI: a field and a button.

No comments:

JavaScript Event Loop Explained

Now for the long answer, let me try through 2 sample code snippets. Here we have the main function which has 2 console.log commands loggin...