August 2017
Beginner
374 pages
10h 41m
English
Just like synchronous action creators, reducers are pure functions. They accept the current state and an action object as arguments and return a new state. As a result, they are very easy to test—we simply compare the expected state after an action with the actual result of the reducer.
For simplicity, we are going to start with the filterReducer:
import { setFilter, clearFilter } from '../../src/actions'import filterReducer from '../../src/reducers/filter'
Read now
Unlock full access