-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: clarify usage of util.promisify.custom #16134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Shiya! 💙
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
doc/api/util.md
Outdated
@@ -525,6 +525,16 @@ console.log(promisified === doSomething[util.promisify.custom]); | |||
This can be useful for cases where the original function does not follow the | |||
standard format of taking an error-first callback as the last argument. | |||
|
|||
For example, if you have a pattern that takes in `(foo, onSuccessCallback, onErrorCallback)`, you can do: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple nits: please avoid the use of the informal pronoun you
in the docs. In fact, I would just remove everything after For example:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment, just needs one small tweak
Somehow messed up the commits... Should I close this PR and open a new one? |
Per requested changes. Since the code will only work for the described pattern.
623a4ff
to
ca0229f
Compare
Ah, fixed it 😅 learned something about rebase today. @jasnell can you review again at your leisure? Thanks! |
PR-URL: #16134 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs/node#16134 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #16134 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
Hoping this addition will help people using
util.promisify.custom
without having to read the source code.Checklist
Affected core subsystem(s)
doc