- convenience initializer for redux-saga apps
yarn add redux redux-saga
yarn add create-saga-core
import createSagaCore from 'create-saga-core'
createSagaCore({ initializer }).then(store => {
/* insert code */
})
function* initializer() {
/* insert code */
}
-
createSagaCore({ reducer, reducers, sagas, initializer })
reducer
- Reducerreducers
- {Reducer}sagas
- {Saga}initializer
- Saga
notes:
- all arguments are optional, though it doesn't make since to provide nothing
- provide either
reducer
orreducers
to participate in state management - resolves with store after
initializer
completes sagas
will be promisified and attached at<Store>.api
- only works in the context of ES modules
- may need to run through transpiler depending on target environment