August 2017
Beginner
374 pages
10h 41m
English
This is the tricky part--now we need to delegate handling the action to the reducer that we got as an argument. Then, we will use its result to insert a new present state.
Replace the return state // TODO line below default: by doing the following:
const newPresent = reducer(present, action)
if (present === newPresent) { return state }
Read now
Unlock full access