on 703ff86 help sign in
bridge/src/lib/isPromise.js
6 lines 251 B history raw
1// an object is a promise if it has a `.then` function
2// https://github.com/then/is-promise/blob/master/index.js
3export const isPromise = obj =>
4 !!obj &&
5 (typeof obj === 'object' || typeof obj === 'function') &&
6 typeof obj.then === 'function';