-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(effects): resubscribe to effects on error (#1881)
BREAKING CHANGE: Prior to introduction of automatic resubscriptions on errors, all effects had effectively {resubscribeOnError: false} behavior. For the rare cases when this is still wanted please add {resubscribeOnError: false} to the effect metadata. BEFORE: ```ts login$ = createEffect(() => this.actions$.pipe( ofType(LoginPageActions.login), mapToAction( // Happy path callback action => this.authService.login(action.credentials).pipe( map(user => AuthApiActions.loginSuccess({ user }))), // error callback error => AuthApiActions.loginFailure({ error }), ) )); ``` AFTER: ```ts login$ = createEffect(() => this.actions$.pipe( ofType(LoginPageActions.login), mapToAction( // Happy path callback action => this.authService.login(action.credentials).pipe( map(user => AuthApiActions.loginSuccess({ user }))), // error callback error => AuthApiActions.loginFailure({ error }), ) // Errors are handled and it is safe to disable resubscription ), {resubscribeOnError: false }); ```
- Loading branch information
1 parent
478b225
commit 71137e5
Showing
14 changed files
with
345 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.