Update arguments order of then

The first argument should be for handling a successful result, and the second for error.
This commit is contained in:
neoarma 2019-04-15 22:46:25 +12:00 committed by GitHub
parent 0a95d04b17
commit dc2da3097e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -102,7 +102,7 @@ function promisify(f, manyArgs = false) {
// usage: // usage:
f = promisify(f, true); f = promisify(f, true);
f(...).then(err => ..., arrayOfResults => ...) f(...).then(arrayOfResults => ..., err => ...)
``` ```
In some cases, `err` may be absent at all: `callback(result)`, or there's something exotic in the callback format, then we can promisify such functions manually. In some cases, `err` may be absent at all: `callback(result)`, or there's something exotic in the callback format, then we can promisify such functions manually.