Skip to content

Instantly share code, notes, and snippets.

@alexytiger
Last active July 7, 2019 17:38
Show Gist options
  • Save alexytiger/7967276be43804de986169f87aadee6b to your computer and use it in GitHub Desktop.
Save alexytiger/7967276be43804de986169f87aadee6b to your computer and use it in GitHub Desktop.
handleError$ = createEffect(
() =>
this.actions$.pipe(
ofType(ErrorActions.errorMessage),
map(action => action.errorMsg),
tap(errorMsg => console.error('Got error:', errorMsg)),
map(errorMsg => {
const msg: SnackBarInterface = {
message: errorMsg,
color: AppearanceColor.Error
};
return SnackBarActions.open({payload: msg})
} )
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment