Closed poying closed 8 years ago
@clonn @tomchentw
There is a way to support es6 promise and we don't need to change the existing interface:
var callbackOrPromise = function (cb, fn) {
if (cb || typeof Promise === 'undefined') {
return fn(cb);
}
return new Promise(function (resolve, reject) {
fn(function (err, res) {
err ? reject(err) : resolve(res);
});
});
};
webhook: (options, callback) =>
return callbackOrPromise
callback
, (callback) =>
# ...
:+1:
hey, any update or further thoughts here?
It says this was released in version 0.1.6 however I don't see it in there.
+1
reading the commit history, I'm not sure this was implemented, unfortunately. gonna close this for now - feel free to implement/send a PR, or wrap via Promise.promisify in your own code base
then we can do:
and