4.0.6 • Published 25 days ago

redux-saga-try-catch v4.0.6

Weekly downloads
976
License
MIT
Repository
github
Last release
25 days ago

Build Status Standard - JavaScript Style Guide npm version

redux-saga-try-catch

includes TypeScript definitions

A saga utility to reduce flow control boilerplate. See the tests.

Install

$ npm install redux-saga-try-catch

Use

FSA

import Catch from 'redux-saga-try-catch'

const io = {
  log: console.log
}

function* aSaga() {
  throw new Error('oh no!')
}

const aSafeSaga = Catch.standardAction(aSaga, io)

aSafeSaga({ type: 'AN_ACTION' }) // logs the error

FSA with meta

import Catch from 'redux-saga-try-catch'

const io = {
  log: console.log
}

function* aSaga() {
  throw new Error('oh no!')
}

const aSafeSaga = Catch.deferredAction(aSaga, io)

const action = { 
  type: 'AN_ACTION',
  meta: {
    deferred: { 
      success: console.log, // a success callback - could be `resolve`
      failure: console.err  // a failure callback - could be `reject`
    }
  }
}

aSafeSaga() // logs the error
4.0.6

25 days ago

4.0.5

4 months ago

4.0.4

5 months ago

4.0.3

6 months ago

4.0.2

6 months ago

4.0.1

8 months ago

3.1.1

1 year ago

3.0.2

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

4.0.0

1 year ago

2.2.9

1 year ago

2.2.8

2 years ago

2.2.7

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.6

2 years ago

2.2.3

4 years ago

2.2.1

4 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.0.0

5 years ago

0.0.5

5 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago