May 2019
Intermediate to advanced
496 pages
10h 38m
English
We've completed our saga; now let's complete the reducer. It already partially handles the ADD_CUSTOMER_SUBMITTING action, but not quite. We'll start there and then move on to handling ADD_CUSTOMER_FAILED, ADD_CUSTOMER_VALIDATION_FAILED, and ADD_CUSTOMER_SUCCESSFUL:
it('maintains existing state', () => { expect(reducer({ a: 123 }, action)).toMatchObject({ a: 123 });});
export const reducer = (state = defaultState, action) => {Read now
Unlock full access