October 2019
Intermediate to advanced
426 pages
11h 49m
English
We are going to start by defining the reducer for the filter value. Let's define the filter reducer now:
import { generateID } from './api'
function filterReducer (state, action) { if (action.type === 'FILTER_TODOS') { return action.filter } else { return state }}
Now, the filterReducer function is defined, and we can handle the FILTER_TODOS action properly.
Read now
Unlock full access