Skip to content

Instantly share code, notes, and snippets.

@JamieMason
Created October 23, 2019 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamieMason/4487134e61394674084df9fb5a440645 to your computer and use it in GitHub Desktop.
Save JamieMason/4487134e61394674084df9fb5a440645 to your computer and use it in GitHub Desktop.
isPromiseLike
const isPromiseLike = obj =>
obj !== null &&
(typeof obj === 'object' || typeof obj === 'function') &&
typeof obj.then === 'function';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment