Commit d3812908 authored by Domenic Denicola's avatar Domenic Denicola Committed by James M Snell
Browse files

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: default avatarStephan Belanger <admin@stephenbelanger.com>
Reviewed-By: default avatarPetka Antonov <petka.antonov@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3438
parent 829eb97f
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment