Reading Notes
How granular should your reducers be? In most cases it will probably be beneficial to have a unique reducer for each action so that it be reused in other processes
Pro or Con – multiple reducers can “fire” when a commonly named action is dispatched In most cases this is probably a con because it would be difficult to make independent changes if necessary
Name a strategy for preventing the above Separate out the actions so each calls a specific reducer
Thunk
middleware allows us to write functions that get dispatch
and getState
as argumentsnpm install redux-thunk
import thunkMiddleware from 'redux-thunk'
const composedEnhancer = composeWithDevTools(applyMiddleware(thunkMiddleware))
import { createStore, applyMiddleware } from 'redux';