Question 1 / 1
A developer adds logger and saver middleware to their store:
const store = createStore(
combineReducers({ colors, sort }),
initialState,
applyMiddleware(logger, saver)
)
After adding the middleware, store.dispatch(addColor('Red', '#FF0000')) is called. The logger correctly prints the prev and next state. But the developer checks localStorage['redux-store'] and finds it contains the state from before the dispatch — the new color is not saved. What is the likely bug in the saver middleware?