reablocks
Version:
Component library for React
8 lines (7 loc) • 358 B
TypeScript
/**
* Type guard for promise-like values. Returns true for native Promises
* and any value exposing a callable `.then` method. Use this instead of
* `instanceof Promise` so cross-realm promises and non-native promise
* libraries (e.g. Bluebird) are also detected.
*/
export declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;