github primus/eventemitter3 2.0.0
Performance improvements

latest releases: 5.0.1, 5.0.0, 4.0.7...
9 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 eventemitter3@2.0.0 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 }
});

Don't miss a new eventemitter3 release

NewReleases is sending notifications on new releases.