Skip to main

isSubject

isSubject

Signature - subject.ts#L66

function isSubject(value: unknown): value is Subject<unknown>

Determines whether the given value is a Subject.

Parameters

ParameterTypeDescription
value
unknown

The value to check.

Returns

TypeDescription
value is Subject<unknown>

Whether the value is a Subject.

Example Usage

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

See Also