emitterer
v0.0.2
Published
Yet another event emitter / state machine
Downloads
10
Maintainers
Readme
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' })