Advertisement
Guest User

doubleFixedEpic

a guest
Oct 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export const subscribeOnCashoutList = (action$, state$) =>
  2.   combineLatest([
  3.     action$.pipe(ofType(actionTypes.API.CONFIGS.COMMON.FETCH.SUCCESS)),
  4.     action$.pipe(ofType(actionTypes.API.CONFIGS.FEATURE_TOGGLING.FETCH.SUCCESS)),
  5.     action$.pipe(ofType(actionTypes.OPEN_LOADED)),
  6.   ]).pipe(
  7.     filter(
  8.       () =>
  9.         isCashoutEnabled(state$.value) &&
  10.         router.currentPathSelector(state$.value).includes('/my'),
  11.     ),
  12.     debounceTime(300),
  13.    
  14.     /*
  15.    
  16.     it needs to emit every time when storeIds property from state$ changes,
  17.     until `takeUntilPageLeave(action$, '/my')` observable fires
  18.  
  19.     */
  20.     switchMap(() =>
  21.       interval(1000).pipe(takeUntilPageLeave(action$, "/my-bet"))
  22.     ),
  23.     switchMap(() => forkJoin(
  24.       from(state$).pipe(
  25.         scan((acc, v) => acc.push(v), [])
  26.       )
  27.     )),
  28.     //.....
  29.     //other chained observables that fetch data based on emitted ids
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement