Apress/pro-react-16

[SOLVED] issue in listing 20-9 customReducerEnhancer

Opened this issue · 0 comments

I've found issue with code in listing and i give it a try by changing the initialState = null from being null to initialState = initialData and it works correctly

also another change works by just changing return initialState to return initialData in this snippet:

return (storeData, action) => {
 if (action.type === STORE_RESET && initialData != null) {
 return intialState; //change this to initialData
 } else {
...

and i want to say thank you for this amazing book, i've learned a lot