is-promise-like
isPromiseLike(obj)
Determines if an object is "Then-able".
Also see isPromise(obj)
which checks for a standard Promise.
var isPromiseLike = require("can-util/js/is-promise-like/is-promise-like");
var promise = new Promise(function(resolve){
resolve();
});
console.log(isPromiseLike(promise)); // -> true
console.log(isPromiseLike("foo bar")); // -> false
Parameters
- obj
{Object}
:An object to be tested.
Returns
{Boolean}
:
True if the object is a Promise.