May 2019
Intermediate to advanced
496 pages
10h 38m
English
This chapter is a little different in that I've already started off the root saga. There are no tests for this yet—shock!—but it should help you understand the structure we're aiming for. We'll fill in each of the methods as we go along. Naturally, if this wasn't a teaching exercise I wouldn't have written this method first—I would have filled it out as I wrote the tests.
The file we'll be working on is named src/middleware/sharingSagas.js. If you open that now, you'll notice two parts to it. First, there's a middleware function named duplicateForSharing:
export const duplicateForSharing = store => next => action => { if (action.type === 'SUBMIT_EDIT_LINE') { store.dispatch({ type: 'SHARE_NEW_ACTION', innerAction: ...Read now
Unlock full access