Skip to content

Commit dc2da30

Browse files
authored
Update arguments order of then
The first argument should be for handling a successful result, and the second for error.
1 parent 0a95d04 commit dc2da30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

1-js/11-async/06-promisify/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function promisify(f, manyArgs = false) {
102102

103103
// usage:
104104
f = promisify(f, true);
105-
f(...).then(err => ..., arrayOfResults => ...)
105+
f(...).then(arrayOfResults => ..., err => ...)
106106
```
107107
108108
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.

0 commit comments

Comments
 (0)