concept saga in category react
appears as: saga, saga, The saga

This is an excerpt from Manning's book Redux in Action.
Listing 6.6. src/index.js
import createSagaMiddleware from 'redux-saga'; #1 import rootSaga from './sagas'; #2 const sagaMiddleware = createSagaMiddleware(); #3 const store = createStore( reducer, composeWithDevTools(applyMiddleware(thunk, sagaMiddleware)) #4 ); sagaMiddleware.run(rootSaga); #5 #1 createSagaMiddleware is the default export of redux-saga. #2 redux-saga needs to know which saga (or sagas) to run. #3 createSagaMiddleware is a factory function, used to create sagaMiddleware. #4 Adds the saga middleware to the list in applyMiddleware #5 Finally, initiate the saga with the run method on the sagaMiddleware instance. !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":0,\"ch\":66},{\"line\":0,\"ch\":68}],[{\"line\":12,\"ch\":0},{\"line\":12,\"ch\":2}],[{\"line\":1,\"ch\":66},{\"line\":1,\"ch\":68}],[{\"line\":13,\"ch\":0},{\"line\":13,\"ch\":2}],[{\"line\":3,\"ch\":66},{\"line\":3,\"ch\":68}],[{\"line\":14,\"ch\":0},{\"line\":14,\"ch\":2}],[{\"line\":7,\"ch\":66},{\"line\":7,\"ch\":68}],[{\"line\":15,\"ch\":0},{\"line\":15,\"ch\":2}],[{\"line\":10,\"ch\":66},{\"line\":10,\"ch\":68}],[{\"line\":16,\"ch\":0},{\"line\":16,\"ch\":2}]]"} !@%STYLE%@!