@duckness/pool-epic-stream
v1.0.0
Published
Duckness Pool Epic Stream - @duckness/epic plugin for @duckness/pool
Downloads
230
Maintainers
Readme
@duckness/pool-epic-stream
@duckness/epic plugin for @duckness/pool
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 ducksrefDucks.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:
- @duckness/duck - Modular Redux Ducks hatchery
- @duckness/saga - Redux Saga extension for @duckness/duck
- @duckness/epic - Redux-Observable extension for @duckness/duck
- @duckness/pool - @duckness/duck + Redux
- @duckness/pool-saga-stream - @duckness/saga plugin for @duckness/pool
- @duckness/pool-epic-stream - @duckness/epic plugin for @duckness/pool
- @duckness/react-redux-pool - @duckness/pool + React-Redux
- @duckness/use-redux - React hook for Redux store
- @duckness/use-pool - React hook for @duckness/pool.
- @duckness/store - simple store for React components
- @duckness/reactor - reactive data flow builder