Rx.ReplaySubject
Represents an object that is both an observable sequence as well as an observer. Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
This class inherits both from the Rx.Observable
and Rx.Observer
classes.
Usage ##
The follow example shows the basic usage of an Rx.ReplaySubject
class. Note that this only holds the past two items in the cache.
Location
rx.binding.js
ReplaySubject Constructor
##
ReplaySubject Constructor
##ReplaySubject Instance Methods
##
ReplaySubject Instance Methods
##Inherited Classes ##
ReplaySubject Constructor ##
Rx.ReplaySubject([bufferSize], [windowSize], [scheduler])
Rx.ReplaySubject([bufferSize], [windowSize], [scheduler])
Initializes a new instance of the Rx.ReplaySubject
class with the specified buffer size, window and scheduler.
Arguments
[bufferSize = Number.MAX_VALUE]
(Number): Maximum element count of the replay buffer.[windowSize = NUMBER.MAX_VALUE]
(Number): Maximum time length of the replay buffer.[scheduler = Rx.Scheduler.currentThread]
(Scheduler): Scheduler the observers are invoked on.
Example
Location
rx.binding.js
ReplaySubject Instance Methods ##
Rx.ReplaySubject.prototype.dispose()
Rx.ReplaySubject.prototype.dispose()
Unsubscribe all observers and release resources.
Example
Location
rx.binding.js
Rx.ReplaySubject.prototype.hasObservers()
Rx.ReplaySubject.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?