Rx.CompositeDisposable
Represents a group of disposable resources that are disposed together.
Usage ##
The follow example shows the basic usage of an Rx.CompositeDisposable.
Location
rx.js
CompositeDisposable Constructor
##
CompositeDisposable Constructor
##CompositeDisposable Instance Methods
##
CompositeDisposable Instance Methods
##CompositeDisposable Instance Properties
##
CompositeDisposable Instance Properties
##CompositeDisposable Constructor ##
Rx.CompositeDisposable(...args)
Rx.CompositeDisposable(...args)
Initializes a new instance of the Rx.CompositeDisposable
class from a group of disposables.
Arguments
args
(Array|arguments): Disposables that will be disposed together.
Example
Location
rx.js
CompositeDisposable Instance Methods ##
Rx.CompositeDisposable.prototype.add(item)
Rx.CompositeDisposable.prototype.add(item)
Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
Arguments
item
(Disposable): Disposable to add.
Example
Location
rx.js
Rx.CompositeDisposable.prototype.clear()
Rx.CompositeDisposable.prototype.clear()
Removes and disposes all disposables from the CompositeDisposable, but does not dispose the CompositeDisposable.
Example
Location
rx.js
Rx.CompositeDisposable.prototype.contains(item)
Rx.CompositeDisposable.prototype.contains(item)
Determines whether the CompositeDisposable contains a specific disposable.
Arguments
item
(Disposable): Disposable to search for.
Returns
(Boolean): true
if the disposable was found; otherwise, false
.
Example
Location
rx.js
Rx.CompositeDisposable.prototype.dispose()
Rx.CompositeDisposable.prototype.dispose()
Disposes all disposables in the group and removes them from the group.
Example
Location
rx.js
Rx.CompositeDisposable.prototype.remove(item)
Rx.CompositeDisposable.prototype.remove(item)
Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
Arguments
item
(Disposable): Disposable to remove.
Returns
(Boolean): true
if the disposable was found and disposed; otherwise, false
.
Example
Location
rx.js
Rx.CompositeDisposable.prototype.rxcompositedisposableprototypetoarray()
Rx.CompositeDisposable.prototype.rxcompositedisposableprototypetoarray()
Converts the existing CompositeDisposable to an array of disposables
Returns
(Array): An array of disposable objects.
Example
Location
rx.js
CompositeDisposable Instance Properties ##
isDisposed
isDisposed
Gets a value that indicates whether the object is disposed.
Example
Location
rx.js
length
length
Gets the number of disposables in the CompositeDisposable.
Example
Location
rx.js
Last updated
Was this helpful?