fix typo in 06-promisify article.md
promisiefy -> promisify
This commit is contained in:
parent
9e99c367ab
commit
a914bad83c
1 changed files with 1 additions and 1 deletions
|
@ -82,7 +82,7 @@ The code may look a bit complex, but it's essentially the same that we wrote abo
|
||||||
|
|
||||||
A call to `promisify(f)` returns a wrapper around `f` `(*)`. That wrapper returns a promise and forwards the call to the original `f`, tracking the result in the custom callback `(**)`.
|
A call to `promisify(f)` returns a wrapper around `f` `(*)`. That wrapper returns a promise and forwards the call to the original `f`, tracking the result in the custom callback `(**)`.
|
||||||
|
|
||||||
Here, `promisiefy` assumes that the original function expects a callback with exactly two arguments `(err, result)`. That's what we encounter most often. Then our custom callback is in exactly the right format, and `promisify` works great for such a case.
|
Here, `promisify` assumes that the original function expects a callback with exactly two arguments `(err, result)`. That's what we encounter most often. Then our custom callback is in exactly the right format, and `promisify` works great for such a case.
|
||||||
|
|
||||||
But what if the original `f` expects a callback with more arguments `callback(err, res1, res2, ...)`?
|
But what if the original `f` expects a callback with more arguments `callback(err, res1, res2, ...)`?
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue