Skip to content

Commit

Permalink
3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Feb 27, 2021
1 parent ec60f7b commit aed9f91
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# 3.3.0

- Support EventTarget emitters in `events.once` from Node.js 12.11.0.

Now you can use the `events.once` function with objects that implement the EventTarget interface. This interface is used widely in
the DOM and other web APIs.

```js
var events = require('events');
var assert = require('assert');

async function connect() {
var ws = new WebSocket('wss://example.com');
await events.once(ws, 'open');
assert(ws.readyState === WebSocket.OPEN);
}

async function onClick() {
await events.once(document.body, 'click');
alert('you clicked the page!');
}
```

# 3.2.0

- Add `events.once` from Node.js 11.13.0.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "events",
"version": "3.2.0",
"version": "3.3.0",
"description": "Node's event emitter for all engines.",
"keywords": [
"events",
Expand Down

0 comments on commit aed9f91

Please sign in to comment.