Last active
March 14, 2019 13:42
-
-
Save alex-okrushko/174ffca3b17c39bbc8cb8055a97eab3f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Dispatch is set to false, so this effect will not try to dispatch | |
| // the result of this effect. | |
| @Effect({ dispatch: false }) | |
| handleFetchError: Observable<unknown> = this.actions$.pipe( | |
| ofType(actions.FETCH_PRODUCTS_ERROR), | |
| map(() => { | |
| // Setting the timeout, so that angular would re-run change detection. | |
| setTimeout( | |
| () => | |
| this.snackBar.open('Error fetching products', 'Error', { | |
| duration: 2500, | |
| }), | |
| 0 | |
| ); | |
| }) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment