Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save truongluu/1f86a805c4f69065ae7996e0ae67368f to your computer and use it in GitHub Desktop.
Save truongluu/1f86a805c4f69065ae7996e0ae67368f to your computer and use it in GitHub Desktop.
removeBurger$: Observable<any> = this.actions$
.ofType('[Menu Page] Add burger')
.switchMap((action: menuActions.AddBurger | details.AddBurger) => {
const p = action.payload;
return this.burgerService.addBurger(p.id)
.mergeMap(res => [
new burgers.Load(), // refresh burger list
new burgers.BurgerAddSuccess('Burger was successfully added.')
])
.catch(err => {
return of(new burgers.AddBurgerFail(err.statusCode));
});
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment