Rx.BehaviorSubject
Represents a value that changes over time. Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
This class inherits both from the Rx.Observable
and Rx.Observer
classes.
Usage ##
The follow example shows the basic usage of an Rx.BehaviorSubject
class.
Location
rx.binding.js
BehaviorSubject Constructor
##
BehaviorSubject Constructor
##BehaviorSubject Instance Methods
##
BehaviorSubject Instance Methods
##Inherited Classes ##
BehaviorSubject Constructor ##
Rx.BehaviorSubject(initialValue)
Rx.BehaviorSubject(initialValue)
Initializes a new instance of the Rx.BehaviorSubject
class which creates a subject that caches its last value and starts with the specified value.
Arguments
initialValue
(Any): Initial value sent to observers when no other value has been received by the subject yet.
Example
Location
= rx.binding.js
BehaviorSubject Instance Methods ##
Rx.BehaviorSubject.prototype.dispose()
Rx.BehaviorSubject.prototype.dispose()
Unsubscribe all observers and release resources.
Example
Location
= rx.binding.js
Rx.BehaviorSubject.prototype.hasObservers()
Rx.BehaviorSubject.prototype.hasObservers()
Indicates whether the subject has observers subscribed to it.
Returns
(Boolean): Returns true
if the Subject has observers, else false
.
Example
Location
= rx.binding.js
Last updated
Was this helpful?