Eventemitter3 Versions Save

EventEmitter3 - Because there's also a number 2. And we're faster.

3.1.2

4 years ago

Bug fixes

  • Revert "[ts] Improve ListenerFn interface (#193)" (08431250).

3.1.1

4 years ago

Bug fixes

  • The ListenerFn interface has been updated to support async functions (#193).

3.1.0

6 years ago

Features

  • A source map is now included in the umd folder of the npm package (a053f61).
  • TypeScript type definitions have been updated to add the ability to specify supported events (#159).

3.0.1

6 years ago

Bug fixes

  • Fixed TypeScript type definitions (#135).

3.0.0

6 years ago

Breaking changes

  • EventEmitter.prototype.listeners() always returns an array. Use EventEmitter.prototype.listenerCount() for existence checking.
  • EventEmitter.prototype.setMaxListeners() has been removed. It was a noop and documented as not supported.
  • Bower and Component are no longer supported.

Features

  • Added EventEmitter.prototype.listenerCount().

2.0.3

7 years ago

The npm package now contains a minified UMD bundle.

2.0.2

7 years ago

This release ships with TypeScript type definitions. Thanks to @delta62, @Stubb0rn, and @roblav96 who helped making this release possible!

2.0.1

7 years ago

This release comes with a minor fix that allows EventEmitter to be imported as module namespace in ES6-compatible environments.

import { EventEmitter } from 'eventemitter3';

2.0.0

7 years ago

This release comes with some nice optimizations which make 2.0.0 our fastest release ever. If you are curious you can see the results of our benchmarks here: https://github.com/primus/eventemitter3/blob/master/benchmarks/README.md.

Breaking changes

The reason for the major version bump is that there is a small breaking change. With eventemitter3@<2.0.0 you could inherit from the EventEmitter class without calling the super constructor.

var EventEmitter = require('eventemitter3');

function MyEmitter() {}

MyEmitter.prototype = Object.create(EventEmitter.prototype, {
  constructor: { value: MyEmitter }
});

With [email protected] this no longer works. Super constructor invocation is required.

var EventEmitter = require('eventemitter3');

function MyEmitter() {
  EventEmitter.call(this);
}

MyEmitter.prototype = Object.create(EventEmitter.prototype, {
  constructor: { value: MyEmitter }
});

1.2.0

8 years ago

This release ships with a new method called eventNames. It returns an array listing the events for which the emitter has registered listeners. The values in the array will be strings or Symbols.

const EventEmitter = require('eventemitter3');

const ee = new EventEmitter();

ee.on('foo', () => {});
ee.on('bar', () => {});
ee.on(Symbol('s'), () => {});

console.log(ee.eventNames());
// => [ 'foo', 'bar', Symbol(s) ]