react-redux-restart
Don't let your sagas die just like that. Catch the errors, allow them to try again.
Example
;;; { ;} { console; ;} const sagas = myMortalSaga { ;}
API
keepAlive(saga, options)
Pass any saga and options. When an error kills it, the keepAlive wrapper will restart it again until it runs out of attempts. If no error handler is passed, sagas will trigger warnings to the console.
defaultBehavior = RESTART disableWarnings = false maxAttempts = 3 onEachError onFail
onFail(error, sagaName, attempts)
Execute any action when saga fails. It can be either a function or another saga.
;; { ;} ;
onFail(error, sagaName, attempts)
Execute any action when saga is killed by error and decide if it is restarted or not. It can be either a function or another saga.
;; { ;} { ; ;} ;
maxAttempts
Configure maximum number of restart attempts.
;;
Whitelist instead of blacklist
Library provides constants that shape the default behavior of the keepAlive function.
- RESTART (the default) - Saga will be restarted unless told othwerwise
- FAIL - Saga will not be restarted unless told otherwise.
;;