Simple EventBus
Usage:
- Assume
MyClass.listen = (data:Dynamic) -> trace(data.text)
- Register listener
EventBus.register_listener(MyClass.listen);
- Dispatch data
EventBus.dispatch({ text: 'hello world' });
this will trace:hello world
- Deregister listener when done:
EventBus.deregister_listener(MyClass.listen)
- or deregister all listeners:
EventBus.deregister_all()