@epikodelabs/streamix / src/public-api / isPromiseLike
Function: isPromiseLike()
isPromiseLike(
value):value is PromiseLike<unknown>
Defined in: projects/libraries/streamix/src/lib/atoms/operator.ts:26
Type guard that checks whether a value behaves like a promise (thenable).
We avoid relying on instanceof Promise so that promise-like values from different realms or custom thenables are still treated correctly.
Note: the return type is PromiseLike<unknown> (not Promise<unknown>) because any object with a .then() method satisfies this check, not just native Promise instances.
Parameters
value
unknown
Returns
value is PromiseLike<unknown>