Skip to content

Event emitter pure is a simple event emitter with the functional programming juice.

License

Notifications You must be signed in to change notification settings

ayesham/event-emitter-pure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

event-emitter-pure

Event Emitter pure is a simple event emitter with the functional programming juice.

Installation

Use the ES6 module import syntax ES6 Module to import the package.

Usage

import eventEmitter from 'node_modules/event-emitter-pure';

// Create a new emitter
let myEmitter = eventEmitter();

// Attach a callback to an event
myEmitter.on('feed:kids', runFastTowardTheDoor);

// Remove a callback from an event
myEmitter.off('feed:kids', runFastTowardTheDoor);

// Attach a callback to an event to run only once
myEmitter.once('eventName', callback);

// Emit an event with some data or no data to fire all active callbacks
myEmitter.emit('eventName', callback);

// Remove all callbacks from the queue for a single event
myEmitter.clear('eventName');

// Completely clean myEmitter's event queue
myEmitter.destroy();

License

MIT

About

Event emitter pure is a simple event emitter with the functional programming juice.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published