1.0.4 • Published 8 years ago

galactic.emitter v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Galactic.emitter(...)

var id = 'dosomething'
var handler = function () {}
var emitter = Galactic.emitter(scope)
emitter.on(id, handler) // register handler
emitter.on.handlers{} // contains all registered handlers
emitter.off(id) // unregister handler
emitter.emit(id, ...data) // emit handler
emitter.emit.andNotifyNewHandlers(id, ...data) // emit handler now and immediately ever after

emitter.andNotifyNewHandlers(...)

emitter.on('dosomething', handler)
emitter.emit.andNotifyNewHandlers('dosomething', ...data) // the on(...) handler above is emitted now
emitter.on('dosomething', handler) // anything called from now on is emitted immediately
1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago