subscribe<T> method
Subscribe to a topic.
Implementation
StreamSubscription<T> subscribe<T>(String topic, void Function(T) onData) {
return _streamController.stream
.where((msg) => msg.topic == topic /*&& msg.data is T*/)
.map((msg) => msg.data as T)
.listen((event) {
if ( Tracer.enabled)
Tracer.trace("editor.bus", TraceLevel.high, " deliver '$topic', event=$event");
onData(event);
});
}