toObservable
Returns an observable sequence with a single notification.
Arguments
[scheduler = Rx.Scheduler.immediate](Scheduler): Scheduler to send out the notification calls on.
Returns
(Observable): The observable sequence that surfaces the behavior of the notification upon subscription.
Example
var source = Rx.Notification.createOnNext(42)
.toObservable();
var subscription = source.subscribe(
x => console.log(`onNext: ${x}`),
e => console.log(`onError: ${e}`),
() => console.log('onCompleted'));
// => onNext: 42
// => onCompletedWithout a scheduler
With a scheduler
Last updated
Was this helpful?