react-on-rails
Version:
react-on-rails JavaScript for react_on_rails Ruby gem
13 lines • 654 B
JavaScript
/* eslint-disable import/prefer-default-export -- named export for grep-ability and consistency with other @internal helpers */
/**
* Narrows an unknown value to a thenable (has a callable `.then`) without assuming a native
* Promise. Shared by the core ClientRenderer, rootErrorHandlers, and the Pro ClientSideRenderer
* (via `react-on-rails/@internal/isThenable`) so non-native thenables are handled identically
* everywhere.
*/
export function isThenable(value) {
return (value != null &&
(typeof value === 'object' || typeof value === 'function') &&
typeof value.then === 'function');
}
//# sourceMappingURL=isThenable.js.map