You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes flatMapLatest(fn) creates the substream fn(x)before the past substream got disposed.
I did not expect this behaviour. When I used tasks.flatMapLatest(sendTaskToWebWorkerAndWaitForCancellationOrResult) to feed tasks into a single WebWorker thread, the webworker did sometimes receive a new task before the previous got cancelled.
If this would be fixed in the library, problems with synchronous substreams (e.g. x => B.once(x)) as in #719 would reappear. On the other hand I don't see much value in synchronous events, since in v2.0 they are discontinued anyway.
So either add a comment to the documentation of flatMapLatest or fix in the library possible breaking stuff?
Sometimes
flatMapLatest(fn)
creates the substreamfn(x)
before the past substream got disposed.I did not expect this behaviour. When I used
tasks.flatMapLatest(sendTaskToWebWorkerAndWaitForCancellationOrResult)
to feed tasks into a single WebWorker thread, the webworker did sometimes receive a new task before the previous got cancelled.Also easy to reproduce using
fromArray
.The reason is that in the implementation, which is roughly
It is unclear if a new
x
value first cancels the previous substreamfn(x).takeUntil(obs)
or first callsfn(x)
to create the next substream.An implementation
might fix it.
However, I don't know if I am aware of all use cases. Otherwise I might attempt a PR.
Do you think it's worth fixing?
The text was updated successfully, but these errors were encountered: