Rx.SerialDisposable

Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource.

Usage ##

The follow example shows the basic usage of an Rx.SerialDisposable.

var serialDisposable = new Rx.SerialDisposable();

var d1 = Rx.Disposable.create(() => console.log('one'));

serialDisposable.setDisposable(d1);

var d2 = Rx.Disposable.create(() => console.log('two'));

serialDisposable.setDisposable(d2);
// => one

serialDisposable.dispose();
// = two

Location

  • rx.js

SerialDisposable Constructor ##

SerialDisposable Instance Methods ##

SerialDisposable Instance Properties ##

SerialDisposable Constructor ##

Rx.SerialDisposable()

#

Initializes a new instance of the Rx.SerialDisposable class.

Example

Location

  • rx.js

SerialDisposable Instance Methods ##

Rx.SerialDisposable.prototype.dispose()

#

Disposes the underlying disposable as well as all future replacements.

Example

Location

  • rx.js

Rx.SerialDisposable.prototype.getDisposable()

#

Gets the underlying disposable.

Returns

(Disposable): The underlying disposable.

Example

Location

  • rx.js

Rx.SerialDisposable.prototype.setDisposable(value)

#

Sets the underlying disposable.

Arguments

  1. value (Disposable): The new underlying disposable.

Example

Location

  • rx.js

SerialDisposable Instance Properties ##

isDisposed

#

Gets a value that indicates whether the object is disposed.

Example

Location

  • rx.js

Last updated

Was this helpful?