Created
March 6, 2019 03:19
-
-
Save alexytiger/df1d5a5adaf88d220ad3fc7d7b1d6b4f 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
@Effect() | |
SetAttack$: Observable<Action> = this.actions$.pipe( | |
ofType(fromAction.ActionTypes.SET_ATTACK), | |
map((action: fromAction.SetAttack) => action.payload), | |
exhaustMap((name: string) => this.ethSrv.setAttack(name).pipe( | |
tap(result => console.log('result', result)), | |
// retrieve the log information that will contain the event data. | |
map(result => result.logs[0].args[0]), | |
map((newName: string) => new fromAction.SetAttackSuccess(newName)), | |
catchError(err => of(new fromAction.EthError(err))) | |
)), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment