Nattily Primped Monster

    @duckness/pool-epic-stream

    0.9.0 • Public • Published

    @duckness/pool-epic-stream

    @duckness/epic 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 PoolEpicStream from '@duckness/pool-epic-stream'
    import CounterEpicDuck from './ducks/CounterEpicDuck'
    
    const CounterPool = Pool({
      buildStore: ({ initialCounter = 0 } = {}) => {
        return { counter: initialCounter }
      }
    })
    CounterPool.addDuck(CounterEpicDuck)
    CounterPool.addStream(PoolEpicStream())
    
    CounterPool.build({initialCounter: 0})
    CounterPool.store
    // => [redux store]

    Table of Contents

    API

    Create Pool Epic Stream

    PoolEpicStream({
      // build custom root epic from ducks instead of default root epic
      ?buildRootEpic: (ducks, { refDucks, refErrorReporter }) => rootEpic
    })

    buildRootEpic

    Optional function for custom root epic (ducks, { refDucks, refErrorReporter }) => rootEpic

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

    default buildRootEpic

    Default root epic will combine all duck root epics (if exists).

    Use Pool Epic Stream

    pool.addStream(PoolEpicStream())

    Examples

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

    @Duckness packages:

    Install

    npm i @duckness/pool-epic-stream

    DownloadsWeekly Downloads

    30

    Version

    0.9.0

    License

    MIT

    Unpacked Size

    11.9 kB

    Total Files

    5

    Last publish

    Collaborators

    • hitosu