Overview of Redux Thunk
In this section we discuss Redux Thunk. So far we have looked at solutions that synchronously interact with the redux store, but what about asynchronous interactions, like fetching from an API or posting to an API. This is where Redux-Thunk comes in, Redux thunk is a middleware solution that facilitates, complex async interaction with the redux store.
Here is the link to GitHub repository, https://github.com/reduxjs/redux-thunk
On the read me page of the repository the link four articles, I have listed the articles in the order that I recommend reading them.
- What the heck is a "thunk"? by Dave Ceddia
- https://daveceddia.com/what-is-a-thunk/
- Thunks in Redux: The Basics by Gabriel Lebec
- https://medium.com/fullstack-academy/thunks-in-redux-the-basics-85e538a3fe60
- Stack Overflow: Dispatching Redux Actions with a Timeout by Dan Abramov
- http://stackoverflow.com/questions/35411423/how-to-dispatch-a-redux-action-with-a-timeout/35415559#35415559
- Stack Overflow: Why do we need middleware for async flow in Redux? by Dan Abramov
- http://stackoverflow.com/questions/34570758/why-do-we-need-middleware-for-async-flow-in-redux/34599594#34599594