August 2017
Beginner
374 pages
10h 41m
English
Now that we have defined the new state, let's rewrite the counter reducer.
const initialState = { history: [0], currentState: 0}export default function counterReducer (state = initialState, action) {
const { history, currentState } = state
const count = history[currentState]
Read now
Unlock full access