We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Error: the promise constructor requires a resolver function
You got this error because you used new Promise() or new Promise(something) without passing a function as the parameter.
new Promise()
new Promise(something)
If you want to wrap an API with a promise manually, the correct syntax is:
function wrapWithPromise(parameter) { return new Promise(function (resolve, reject) { doSomethingAsync({ error:reject, success:resolve }); }); }
Please consider reading more about it and also consider checking out automatic promisification as well as Promise.method
Promise.method