Created
May 2, 2019 08:01
-
-
Save truongluu/1f86a805c4f69065ae7996e0ae67368f to your computer and use it in GitHub Desktop.
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
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