Normally Pleasant Mixture

    @duckness/pool-saga-stream

    0.9.0 • Public • Published

    @duckness/pool-saga-stream

    @duckness/saga plugin for @duckness/pool

    NPM License Libraries.io dependency status for latest release, scoped npm package GitHub issues vulnerabilities npm bundle size

    Example

    import Pool from '@duckness/pool'
    import PoolSagaStream from '@duckness/pool-saga-stream'
    import CounterSagaDuck from './ducks/CounterSagaDuck'
    
    const CounterPool = Pool({
      buildStore: ({ initialCounter = 0 } = {}) => {
        return { counter: initialCounter }
      }
    })
    CounterPool.addDuck(CounterSagaDuck)
    CounterPool.addStream(PoolSagaStream())
    
    CounterPool.build({initialCounter: 0})
    CounterPool.store
    // => [redux store]

    Table of Contents

    API

    Create Pool Saga Stream

    PoolSagaStream({
      // build custom root saga from ducks instead of default root saga
      ?buildRootSaga: (ducks, { refDucks, refErrorReporter }) => rootSaga*
    })

    buildRootSaga

    Optional function for custom root saga (ducks, { refDucks, refErrorReporter }) => rootSaga*

    • ducks are array of ducks
    • refDucks.current will hold current array of ducks.
    • refErrorReporter.current will hold current error reporter function.

    default buildRootSaga

    Default root saga will combine all duck root sagas (if exists) wrapped in try/catch restarting duck root saga in case of exception.

    Use Pool Saga Stream

    pool.addStream(PoolSagaStream())

    Examples

    https://github.com/hitosu/duckness/tree/master/stories

    @Duckness packages:

    Install

    npm i @duckness/pool-saga-stream

    DownloadsWeekly Downloads

    21

    Version

    0.9.0

    License

    MIT

    Unpacked Size

    12.5 kB

    Total Files

    5

    Last publish

    Collaborators

    • hitosu