Guest User

Untitled

a guest
Nov 17th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. // ...
  2. @Injectable()
  3. export class UserEffects {
  4.  
  5. @Effect({ dispatch: false }) onSomeActionTriggered: Observable<any> = this.actions
  6. .ofType(SOME_ACTION)
  7. .do((data: any) => this.store.dispatch({
  8. type: SOME_OTHER_ACTION,
  9. payload: data.value
  10. }))
  11. .switchMap((data: any) => this.userAuthenticationService.authenticateUser(data.user))
  12. .map((data: any) => this.parseService.parseData(data))
  13. .switchMap((data: any) => Observable.fromPromise(
  14. this.router.navigate(['/random', data.param]))
  15. );
  16. // ...
Add Comment
Please, Sign In to add comment