UNPKG

theta-client-react-native

Version:

This library provides a way to control RICOH THETA using.

11 lines (10 loc) 319 B
/** * Type guard to check if a value is promise-like (has a `then` method). */ export function isPromiseLike<T>(value: unknown): value is Promise<T> { return ( value != null && (typeof value === 'object' || typeof value === 'function') && typeof (value as { then?: unknown }).then === 'function' ); }