Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const subscribeOnCashoutList = (action$, state$) =>
- combineLatest([
- action$.pipe(ofType(actionTypes.API.CONFIGS.COMMON.FETCH.SUCCESS)),
- action$.pipe(ofType(actionTypes.API.CONFIGS.FEATURE_TOGGLING.FETCH.SUCCESS)),
- action$.pipe(ofType(actionTypes.OPEN_LOADED)),
- ]).pipe(
- filter(
- () =>
- isCashoutEnabled(state$.value) &&
- router.currentPathSelector(state$.value).includes('/my'),
- ),
- debounceTime(300),
- /*
- it needs to emit every time when storeIds property from state$ changes,
- until `takeUntilPageLeave(action$, '/my')` observable fires
- */
- switchMap(() =>
- interval(1000).pipe(takeUntilPageLeave(action$, "/my-bet"))
- ),
- switchMap(() => forkJoin(
- from(state$).pipe(
- scan((acc, v) => acc.push(v), [])
- )
- )),
- //.....
- //other chained observables that fetch data based on emitted ids
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement