August 2017
Beginner
374 pages
10h 41m
English
Now, we need to handle all counter-related actions:
switch (action.type) { case INCREMENT:
return { ...state,
history: [ ...history, count + 1 ],
currentState: history.length }
case DECREMENT: return { ...state, history: [ ...history, count - 1 ], currentState: history.length }
case RESET: return ...
Read now
Unlock full access