Nearly Perpendicular Macaroons

    @duckness/saga

    0.9.0 • Public • Published

    @duckness/saga

    Redux Saga extension for @duckness/duck

    NPM License Libraries.io dependency status for latest release, scoped npm package GitHub issues vulnerabilities npm bundle size

    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 with sagas isolation (exceptions in one saga will not break other sagas).

    myDuck.rootSaga

    Error reporter

    .setErrorReporter

    Set error reporter (default is console.error) that reports uncatched saga errors

    myDuck.setErrorReporter(error => {
      window.Sentry.captureException(error)
    })

    .reportError(error)

    Call assigned error reporter

    myDuck.reportError(new Error('Clean duck!'))

    @Duckness packages:

    Install

    npm i @duckness/saga

    DownloadsWeekly Downloads

    22

    Version

    0.9.0

    License

    MIT

    Unpacked Size

    11.7 kB

    Total Files

    5

    Last publish

    Collaborators

    • hitosu