doc: more use-cases for promise events · nodejs/node@d381290 · GitHub
Skip to content

Commit d381290

Browse files
domenicjasnell
authored andcommitted
doc: more use-cases for promise events
This adds an example of a semi-common promise pattern that could result in false-positive 'unhandledRejection' events, to help motivate why there is a dual 'rejectionHandled' event. I anticipate it being helpful to users who encounter 'unhandledRejection' events that do not stem from obvious typos such as the JSON.pasre example. Also cleans up the promise rejection tracking sample. By using a Map instead of array we can get O(1) deletion and actually record the errors. And, fixed indentation and backtick usage there to align with the rest of the document. Reviewed-By: Stephan Belanger <admin@stephenbelanger.com> Reviewed-By: Petka Antonov <petka.antonov@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: #3438
1 parent 829eb97 commit d381290

1 file changed

Lines changed: 32 additions & 9 deletions

File tree

doc/api/process.markdown

Lines changed: 32 additions & 9 deletions

0 commit comments

Comments
 (0)