emitterer

0.0.2 • Public • Published

emitterer

Because the world needs more event interfaces

example

var Store = require('emitterer')
 
// initial state
var store = Store({})
 
// call me when state changes
store(function onChange(state) {
  console.log(state)
})
 
// get current state
console.log(store())
 
// return an object that will xtend `oldState`
store.on('data', function(action, oldState) {
  return action
})
 
// pass something to the 'data' listener
store.emit('data', { test: 'party' })

Package Sidebar

Install

npm i emitterer

Weekly Downloads

2

Version

0.0.2

License

ISC

Last publish

Collaborators

  • nichoth