firstSubject$
completes there is no leakage from delayWhen whatsoever
firstSubject$
remember it completed?
complete()
right away once you subscribe again on new commits from second$
Hi there, say I have a high-order observable. It basically contains a set of set of numbers.
I'd like the first inner observable to be listened to until the next inner observable is available. Then the next one should be listened to. I know there's switchMap
, but I can't seem to get it to work.
const setOfSetOfNums$ = merge(
of([4,5,6,7]).pipe(delay(50)),
of([0,1,2,3]),
).pipe(
distinctUntilChanged(),
switchMap(context => of(...context)),
)
zip(interval(1000), setOfSetOfNums$).pipe(
map(([_, hand]) => hand),
)
I would expect this to output something like:
---0---1---4---5---6---7--->
But it spits out:
---0---1---2---3---4---5---6---7--->
---0---1---4---5---6---7--->
setOfSetOfNums$
, we should immediately switch to that
const setOfSetOfNums$ = merge(
of([4,5,6,7]).pipe(delay(50)),
of([0,1,2,3]),
).pipe(
switchMap(context => zip(interval(1000), from(context))),
map(([_, hand]) => hand)
)