eventemitter3

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

MIT License

Downloads
144.4M
Stars
3.2K
Committers
30

Bot releases are visible (Hide)

eventemitter3 - Latest Release

Published by lpinca over 1 year ago

Bug fixes

  • Moved the types condition to the top (#258).
eventemitter3 -

Published by lpinca almost 2 years ago

Breaking changes

  • The umd directory has been renamed to dist and the eventemitter3.min.js
    bundle to eventemitter3.umd.min.js (#252).
  • Importing the module with the TypeScript-specific
    import EventEmitter = require('eventemitter3') syntax is no longer
    supported (#252).

Features

  • Added ESM support (#252).
eventemitter3 -

Published by lpinca about 4 years ago

Bug fixes

  • Refined types to improve extends behavior (#234).
eventemitter3 -

Published by lpinca about 4 years ago

Bug fixes

  • Fixed TypeScript type definitions (#232).
eventemitter3 -

Published by lpinca about 4 years ago

Bug fixes

  • Fixed TypeScript type definitions (#231).
eventemitter3 -

Published by lpinca over 4 years ago

Bug fixes

  • Fixed compatibility with TypeScript 3.9 (#226).
eventemitter3 -

Published by lpinca over 4 years ago

Bug fixes

  • Fixed regressions introduced in version 4.0.1 and 4.0.2 (#224).
eventemitter3 -

Published by lpinca over 4 years ago

Bug fixes

  • Fixed regressions introduced in version 4.0.1 (#223).
eventemitter3 -

Published by lpinca over 4 years ago

Bug fixes

  • Improved TypeScript type definitions (#219).
eventemitter3 -

Published by lpinca over 5 years ago

Breaking changes

  • TypeScript type definitions now require TypeScript 3.
eventemitter3 -

Published by lpinca over 5 years ago

Bug fixes

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

Published by lpinca over 5 years ago

Bug fixes

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

Published by lpinca over 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).
eventemitter3 -

Published by lpinca over 6 years ago

Bug fixes

  • Fixed TypeScript type definitions (#135).
eventemitter3 -

Published by lpinca almost 7 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().
eventemitter3 - UMD bundle

Published by lpinca over 7 years ago

The npm package now contains a minified UMD bundle.

eventemitter3 - TypeScript definitions

Published by lpinca about 8 years ago

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

eventemitter3 - ES6 import

Published by lpinca about 8 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';
eventemitter3 - Performance improvements

Published by lpinca about 8 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 }
});
eventemitter3 - eventNames

Published by lpinca over 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) ]