-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: add a switchScan operator #2931
Comments
while it is not concluded yet, we're discussing of plan for mergeScan itself (#2737) and for now, we recommend to create operator as user-level first instead of direct addition into core lib. (https://github.com/ReactiveX/rxjs/blob/master/doc/operator-creation.md#diy-custom-operators-for-end-users). |
I have stumbled across a situation where a |
@kylecordes is your scenario solved by just passing concurrency=1? |
@bradleyayers I'm not sure - I ended up solving the problem I was having a completely different way, with a group operation plus a switch map. |
This just came up at Google... I'm going to reopen it. Here's a minimal implementation in JS: http://jsbin.com/kiyoyir/3/edit?js,console |
@benlesh I think you forgot of disposal of outer subscription in that demo. |
Closing this in favour of #4442 - which has an associated PR and has been discussed in a core-team meeting. |
* feat(switchScan): add switchScan operator * refactor(switchScan): Make switchScan behavior more close to `scan()` Closes #2931 * docs(switchScan): add link switchScan marble diagram into its docblock * test(switchScan): revert running only switchScan spec * fix(switchScan): fix overriding the same seed for multiple observers * docs(switchScan): fix typo * refactor(switchScan): make seed mandatory as in mergeScan * fix(switchScan): fix typings for union types, remove duplicate dts test * test(switchScan): fix types after rebase to master * refactor(switchScan): use `operate` and `switchMap`. * chore: update golden files * chore: address comments Co-authored-by: Ben Lesh <[email protected]>
It will be similar as the mergeScan but instead of merging all events of inner observables, if the outer source emitted a new event, it switch to the recently accumulated inner observable.
The text was updated successfully, but these errors were encountered: