The Observable interface that implements the Reactive Pattern.
Provides a mechanism for receiving push-based notifications.
Provides a mechanism for receiving push-based notifications.
After an Observer calls an rxscalajs.Observable's subscribe
method, the Observable
calls the Observer's onNext
method to provide notifications. A well-behaved Observable will
call an Observer's onCompleted
or onError
methods exactly once.
A Subject is an Observable and an Observer at the same time.
Subject that, once an Observer
has subscribed, emits all subsequently observed items to the
subscriber.
Subject that, once an Observer
has subscribed, emits all subsequently observed items to the
subscriber.
val subject = Subject[String]() // observer1 will receive all onNext and onCompleted events subject.subscribe(observer1) subject.onNext("one") subject.onNext("two") // observer2 will only receive "three" and onCompleted subject.subscribe(observer2) subject.onNext("three") subject.onCompleted()