1.0.0 • Published 11 months ago

@duckness/pool-epic-stream v1.0.0

Weekly downloads
8
License
MIT
Repository
github
Last release
11 months ago

@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:

1.0.0

11 months ago

0.10.0

1 year ago

0.9.0

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.5

3 years ago

0.7.4

3 years ago

0.7.3

3 years ago

0.7.2

3 years ago

0.7.1

3 years ago