janmonschke / diffsync

Enables real-time collaborative editing of arbitrary JSON objects
MIT License
222 stars 23 forks source link

Prototypal inheritance with EventEmitter #8

Open mvladic opened 8 years ago

mvladic commented 8 years ago

I'm experiencing some bugs because _events from EventEmitter is shared between Client instances.

Check this out:

https://github.com/nodejs/node-v0.x-archive/issues/7157

In client.js, instead of:

// inherit from EventEmitter
Client.prototype = new EventEmitter();

it should be:

// inherit from EventEmitter
util.inherits(Client, EventEmitter);