Skip to content

Releases: primus/eventemitter3

EventEmitter.prefixed

12 May 12:06
Compare
Choose a tag to compare

We added a minor feature in this release.
The EventEmitter constructor now has a prefixed property which lets you know what is the character used to prefix the event names. This property is set to false when Object.create() is available.

var prefix =  require('eventemitter3').prefixed;
console.log(prefix);

Restore performances

12 May 08:40
Compare
Choose a tag to compare

This release brings back the performances of version 0.1.6 without sacrificing features and safety.

Symbols

07 May 08:38
Compare
Choose a tag to compare

This releases brings support for using ES6 Symbols for event names!

Breaking changes

22 Apr 17:49
Compare
Choose a tag to compare

The way we export the module is changed. For legacy reasons we also supported .EventEmitter property on the returned eventemitter3 object but this has been completely removed. So your previous:

var EventEmitter = require('eventemitter3').EventEmitter;

Should be changed to:

var EventEmitter = require('eventemitter3');

In addition to that we've made a breaking change the internal argument order of the removeListener api. Historically we used the third argument as indication that only once listeners but we've changed to allow the third argument to be used as context argument as we could also remove listeners based on the context.

Other than that, we added support for a second argument in the listeners API. Happy hacking.

Context and Fixes

13 Jan 20:29
Compare
Choose a tag to compare

First, a new feature. I've added support for context based emits by adding a third context param to on and once as illustrated by this example:

var e = new EventEmitter();

e.on('event', function () {
  this === context
}, context);

In addition to that, I've detected a critical bug that cause the complete events object to be erased when one of the events was added using .once.