emit<T> method
Emit a event with a specific event type and data type. This will broadcast the message to all listeners that match the same event type and data type.
StreamEventEmitter events = StreamEventEmitter();
...
events.emit('message', 'Hello World');
Same as emitEvent, but with a simpler syntax.
Implementation
void emit<T>(String type, T data) => emitEvent(Event<T>(type, data));