Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import {DECREASE, INCREASE, STOP_COUNTER, FETCH_USER, INCREASE_DONE} from '../actions/type';
  2. import {Observable} from 'rxjs';
  3.  
  4. export const counterEpic = action$ =>
  5. action$.ofType(INCREASE)
  6. .mergeMap(() => Observable.timer(0,30)
  7. .takeUntil(Observable.timer(1000))
  8. .map(() => ({type:INCREASE_DONE}))
  9. .takeUntil(action$.ofType(STOP_COUNTER))
  10. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement