Returns a version of func which returns a Promise rather than expecting a callback.
The argument that will be passed to the callback.
The type of func.
Function that expects a callback as its first argument.
const fn = (callback, a, b) => doSomething(callback, a, b);const promised = asPromise(fn);promised(1, 2).then(result => console.log(result)); Copy
const fn = (callback, a, b) => doSomething(callback, a, b);const promised = asPromise(fn);promised(1, 2).then(result => console.log(result));
Returns a version of func which returns a Promise rather than expecting a callback.