Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

SwitchOnNext - better example included #61

Open
nigelm187 opened this issue Jan 10, 2019 · 0 comments
Open

SwitchOnNext - better example included #61

nigelm187 opened this issue Jan 10, 2019 · 0 comments

Comments

@nigelm187
Copy link
Contributor

nigelm187 commented Jan 10, 2019

https://github.com/SoftwareAG/apama-rxepl/blob/master/docs/interfaces/IObservable.md#switchonnext

Below is a better example which I created for SwitchOnNext

any switchOnNextExample := Observable
    .fromValues([Observable.range(1,5).delay(1.0), Observable.fromValues([10,11,12,13,14,15])])
    .switchOnNext()
    .subscribe(LoggingSubscriber.create("SwitchOnNext Example"));

Which shows that the second Observable actioned as it arrived before the first due to the delay

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants