The use case sounds familiar, in the past I've wanted this operator named "sameTimeAs", but ended up refactoring so I didn't need that operator. There isn't a single operator that does this but you can easily achieve it with windowToggle + mergeAll.
@andrestaltz haa, bit out of the blue question here -- but do you know of an RxJs operator (or similar) that does: "only emit this event if it's been within <dur> of another event".
Kind of like an inverse debounce. Or perhaps a debounce with a lower bound on occurrences.
-
-
- 1 more reply
New conversation -
-
-
triggeringSource$.pipe( exhaustMap(() => eventSource$.pipe( takeUntil(timer(5000)) ) ) When triggeringSource$ fires, start taking from eventSource$ for 5 seconds, but wait until those 5 seconds are up before waiting for a new triggeringSource$ to start it again.
-
Alternatively, eventSource$ can be the trigger: eventSource$.pipe( groupBy( () => true, grouped$ = grouped$.pipe(takeUntil(timer(5000))) ), mergeAll(), ) Although, I'm not sure what this buys you, as the output stream would be roughly equal to the input.
- 1 more reply
New conversation -
-
-
Maybe
@BenLesh can help too.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.