Skip to main

isDisposable

isDisposable

Signature - disposable.ts#L364

function isDisposable(value: unknown): value is Disposable

Determines whether the given value is a Disposable.

Parameters

ParameterTypeDescription
value
unknown

The value to check.

Returns

TypeDescription
value is Disposable

Whether the value is a Disposable.

Example Usage

isDisposable(Sink(() => {})); // true.
isDisposable(Source(() => {})) // false.
isDisposable(Subject()); // true.
isDisposable(Disposable()); // true.
isDisposable({}); // false.
isDisposable(() => {}); // false.
isDisposable(null); // false.

See Also