flood-simple-form
Version:
The Data Down, Actions Up form builder with ember-changeset and validations
15 lines (11 loc) • 302 B
JavaScript
import Ember from 'ember';
const { typeOf } = Ember;
function isPromiseLike(obj = {}) {
return !!obj
&& typeOf(obj.then) === 'function'
&& typeOf(obj.catch) === 'function'
&& typeOf(obj.finally) === 'function';
}
export default function isPromise(obj) {
return isPromiseLike(obj);
}