1.0.0 • Published 11 months ago

@duckness/pool-saga-stream v1.0.0

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

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

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

0.6.11

3 years ago

0.6.10

3 years ago

0.6.9

4 years ago

0.6.7

4 years ago

0.6.6

4 years ago

0.6.5

4 years ago

0.6.4

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.5

4 years ago

0.5.4

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.4

4 years ago

0.4.1

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.0

4 years ago