Represents a type which can release resources, such as event listening or a timer.

Static methods

staticfrom(disposableLikes:Rest<{dispose:() ‑> Void}>):Disposable

Combine many disposable-likes into one. Use this method when having objects with a dispose function which are not instances of Disposable.

Parameters:

disposableLikes

Objects that have at least a dispose-function member.

Returns:

Returns a new disposable which, upon dispose, will dispose all provided disposables.

Constructor

new(callOnDispose:Function)

Creates a new Disposable calling the provided function on dispose.

Parameters:

callOnDispose

Function that disposes something.

Methods

dispose():Void

Dispose this object.