0.1.3 • Published 5 years ago

create-saga-core v0.1.3

Weekly downloads
2
License
Beerware
Repository
github
Last release
5 years ago

create-saga-core

get started

install

yarn add redux redux-saga

yarn add create-saga-core

basic template

import createSagaCore from 'create-saga-core'

createSagaCore({ initializer }).then(store => {
  /* insert code */
})

function* initializer() {
  /* insert code */
}

api

  • createSagaCore({ reducer, reducers, sagas, initializer })

    • reducer - Reducer
    • reducers - {Reducer}
    • sagas - {Saga}
    • initializer - Saga

    notes:

    • all arguments are optional, though it doesn't make since to provide nothing
    • provide either reducer or reducers to participate in state management
    • resolves with store after initializer completes
    • sagas will be promisified and attached at <Store>.api

caveats

  • only works in the context of ES modules
  • may need to run through transpiler depending on target environment