How to use the eventemitter2.EventEmitter2.apply function in eventemitter2

To help you get started, we’ve selected a few eventemitter2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trupin / crawlable / lib / persistence / index.js View on Github external
var Persistence = module.exports = function () {
    EventEmitter.apply(this, arguments);

    this.name = _.uniqueId('c');
    this.on('create', this.onCreate.bind(this));
    this.on('update', this.onUpdate.bind(this));
    this.on('delete', this.onDelete.bind(this));
    this.on('read', this.onRead.bind(this));
};

eventemitter2

A feature-rich Node.js event emitter implementation with namespaces, wildcards, TTL, async listeners and browser/worker support.

MIT
Latest version published 2 years ago

Package Health Score

82 / 100
Full package analysis