1.0.6 • Published 4 years ago
duckness-saga v1.0.6
THIS PACKAGE IS LEGACY, PLEASE UPDATE TO @duckness/saga
duckness-saga
Saga extension for Duckness - Modular Redux Ducks hatchery.
Example
// counterDuck.js
import SagaDuck from 'duckness-saga'
// Create duck with the name 'counter' for 'counter-app' app
const counterDuck = SagaDuck('counter', 'counter-app')
// add saga
counterDuck.saga(function* watchIncrementAsync(_duckFace) {
yield takeEvery('INCREMENT_ASYNC', incrementAsync)
})
// root saga
export const rootSaga = counterDuck.rootSaga
Table of Contents
API
SagaDuck
extends duckness
Duck
Saga
.saga(saga)
Adds a new saga to the duck
myDuck.saga(function* mySaga(duckFace) { /*...*/ })
.rootSaga
Duck's root saga that handles errors and restarts sagas that throws exceptions.
myDuck.rootSaga
Error reporter
.errorReporter
Set error reporter (default is console.error
) that reports uncatched saga errors
myDuck.errorReporter(error => {
window.Raven.captureException(error)
})
Additional resources
- duckness - Duckness - Modular Redux Ducks hatchery
- duckness-pool - boilerplate for React-Redux apps based on Duckness and Duckness-Saga