Skip to content
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: update events docs for consistency #33678

Merged
merged 2 commits into from
Jun 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions doc/api/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ It supports the following option:

* `captureRejections` {boolean} It enables
[automatic capturing of promise rejection][capturerejections].
Default: `false`.
**Default:** `false`.

### Event: `'newListener'`
<!-- YAML
Expand Down Expand Up @@ -974,9 +974,8 @@ There are two key differences between the Node.js `EventTarget` and the

The `NodeEventTarget` object implements a modified subset of the
`EventEmitter` API that allows it to closely *emulate* an `EventEmitter` in
certain situations. It is important to understand, however, that an
`NodeEventTarget` is *not* an instance of `EventEmitter` and cannot be used in
place of an `EventEmitter` in most cases.
certain situations. A `NodeEventTarget` is *not* an instance of `EventEmitter`
and cannot be used in place of an `EventEmitter` in most cases.

1. Unlike `EventEmitter`, any given `listener` can be registered at most once
per event `type`. Attempts to register a `listener` multiple times will be
Expand Down Expand Up @@ -1219,11 +1218,12 @@ added: REPLACEME
* `listener` {Function|EventListener}
* `options` {Object}
* `once` {boolean} When `true`, the listener will be automatically removed
when it is first invoked. *Default*: `false`
when it is first invoked. **Default:** `false`.
* `passive` {boolean} When `true`, serves as a hint that the listener will
not call the `Event` object's `preventDefault()` method. *Default*: `false`
not call the `Event` object's `preventDefault()` method.
**Default:** `false`.
* `capture` {boolean} Not directly used by Node.js. Added for API
completeness. *Default*: `false`
completeness. **Default:** `false`.

Adds a new handler for the `type` event. Any given `listener` will be added
only once per `type` and per `capture` option value.
Expand Down