Skip to content

Instantly share code, notes, and snippets.

@moniuch
Created July 27, 2018 21:41
Show Gist options
  • Save moniuch/37161dc357c34efaf13865beaa99fa63 to your computer and use it in GitHub Desktop.
Save moniuch/37161dc357c34efaf13865beaa99fa63 to your computer and use it in GitHub Desktop.
Effect resilience
.ofType(SOMETYPE).pipe(
tap(_ => console.log('effect still alive and kicking')),
map(action => action.payload),
// switchMap, mergeMap, concatMap, exhaustMap?
switchMap(payload => this.myService.putSomething(payload).pipe(
map(response => new MySuccessAction(response)),
catchError(err => of(new MyFailureAction())),
),
)
// service.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment