MCPcopy Index your code
hub / github.com/TanStack/db / isPromiseLike

Function isPromiseLike

packages/db/src/utils/type-guards.ts:6–12  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

4 * @returns True if the value is promise-like, false otherwise
5 */
6export function isPromiseLike(value: unknown): value is PromiseLike<unknown> {
7 return (
8 !!value &&
9 (typeof value === `object` || typeof value === `function`) &&
10 typeof (value as { then?: unknown }).then === `function`
11 )
12}

Callers 2

createOptimisticActionFunction · 0.90
utils.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected