Skip to content

Commit

Permalink
3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Jan 8, 2020
1 parent 0754cd5 commit 4f03fbf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
19 changes: 19 additions & 0 deletions History.md
@@ -1,3 +1,22 @@
# 3.1.0 (2020-01-08)

`events` now matches the Node.js 11.12.0 API.

- pass through return value in wrapped `emitter.once()` listeners

Now, this works:
```js
emitter.once('myevent', function () { return 1; });
var listener = emitter.rawListeners('myevent')[0]
assert(listener() === 1);
```
Previously, `listener()` would return undefined regardless of the implementation.

Ported from https://github.com/nodejs/node/commit/acc506c2d2771dab8d7bba6d3452bc5180dff7cf

- Reduce code duplication in listener type check ([#67](https://github.com/Gozala/events/pull/67) by [@friederbluemle](https://github.com/friederbluemle)).
- Improve `emitter.once()` performance in some engines

# 3.0.0 (2018-05-25)

**This version drops support for IE8.** `events` no longer includes polyfills
Expand Down
4 changes: 2 additions & 2 deletions Readme.md
Expand Up @@ -4,7 +4,7 @@
This implements the Node.js [`events`](http://nodejs.org/api/events.html) module for environments that do not have it, like browsers.

> `events` currently matches the **Node.js 10.1** API.
> `events` currently matches the **Node.js 11.12.0** API.
Note that the `events` module uses ES5 features. If you need to support very old browsers like IE8, use a shim like [`es5-shim`](https://www.npmjs.com/package/es5-shim). You need both the shim and the sham versions of `es5-shim`.

Expand Down Expand Up @@ -34,7 +34,7 @@ ee.emit('message', 'hello world')

## API

See the [Node.js EventEmitter docs](http://nodejs.org/api/events.html). `events` currently matches the Node.js 10.1 API.
See the [Node.js EventEmitter docs](http://nodejs.org/api/events.html). `events` currently matches the Node.js 11.12.0 API.

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "events",
"id": "events",
"version": "3.0.0",
"version": "3.1.0",
"description": "Node's event emitter for all engines.",
"keywords": [
"events",
Expand Down

0 comments on commit 4f03fbf

Please sign in to comment.