fetchBookAction function is the place where redux-thunk is used so that instead of returning a simple action object, it returns another function that receives dispatch function as the first parameter. In this way redux-thunk delays the dispatch of the original action by first getting the data asynchronous and only when data is ready we dispatch another action with the result.

In order to follow easier the changes, I’ll extract relevant code samples after adding redux-saga in this project. Please note that I’ll focus only in the updates, code that did not change will not be added again.