cached-events

0.0.1 • Public • Published

cached-events

Cache an Event Emitter

Example

Stores the emitted event for an event in a cache and will immediately fire an attached event listeners if that event is in the cache.

Good for things where you want to be notified when something happens but don't want to worry about binding listeners before it happens

var CachedEmitter = require("../index")
 
var login = CachedEmitter()
 
login.emit("login", "steve", "jones")
 
login.on("login", function (user, pass) {
    console.log(user, pass)
})
 

Installation

npm install cached-events

Contributors

  • Raynos

MIT Licenced

Readme

Keywords

none

Package Sidebar

Install

npm i cached-events

Weekly Downloads

19

Version

0.0.1

License

none

Last publish

Collaborators

  • raynos