subscribe<T> method
Subscribe to an event topic. Events that get posted to that topic will trigger the provided handler
topic
The topic to subscribe tohandler
The event handler
Implementation
subscribe<T>(String topic, EventHandler<T> handler) {
if (_callbackMaps[topic] == null) {
_callbackMaps[topic] = [].cast<EventHandler<T>>();
}
List<EventHandler<T>> handlers = _callbackMaps[topic];
handlers.add(handler);
}