@duckness/pool-epic-stream
TypeScript icon, indicating that this package has built-in type declarations

1.0.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:

Package Sidebar

Install

npm i @duckness/pool-epic-stream

Weekly Downloads

89

Version

1.0.0

License

MIT

Unpacked Size

12.1 kB

Total Files

6

Last publish

Collaborators

  • hitosu