Redux Thunk - evan-401-advanced-javascript/seattle-javascript-401d31 GitHub Wiki
Using redux is handy for handling apps with a lot of state to manage. But what happens when some of the actions you dispatch need to access external API's? That is where Thunks' come in. Using Thunks we can communicate asynchronously with external API's.
To use a thunk first import thunk as shown below:
import thunk from 'redux-thunk';
Then you will want to use the thunk with your redux store by using redux's applyMiddleware and invoking thunk like below:
const store = createStore(rootReducer, applyMiddleware(thunk));