Skip to content

evEmitter is a realization event Emitter on syntax ES2015

License

Notifications You must be signed in to change notification settings

alexeyvax/EvEmitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EvEmitter-alexeyvax

EvEmitter is a realization Event Emitter on syntax ES2015. Emitter used to link multiple files.

Installation

npm install --save evemitter-alexeyvax

Example

// first file 'createEmitter.js'
import EventEmitter from 'evemitter-alexeyvax';

// create new emitter
const emitter = new EventEmitter();

// add listener in storage
emitter.addListener( 'anyNamelistener', ( item ) =>
{
    console.log( item );
});

// remove listener from storage
emitter.removeListener( 'anyNamelistener' );

export {
    emitter
}

**********

// another file

import emitter from 'createEmitter.js';

// transfers changes all listeners
emitter.emit( 'anyNamelistener', item );

About

evEmitter is a realization event Emitter on syntax ES2015

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published