Skip to main

isSource

isSource

Signature - source.ts#L562

function isSource(value: unknown): value is Source<unknown>

Determines whether the given value is a Source.

Parameters

ParameterTypeDescription
value
unknown

The value to check.

Returns

TypeDescription
value is Source<unknown>

Whether the value is a Source.

Example Usage

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

See Also