eventStream<T> method
Implementation
Stream<T> eventStream<T>(String method, WipEventTransformer<T> transformer) {
return _eventStreams
.putIfAbsent(
method,
() => StreamTransformer.fromHandlers(
handleData: (WipEvent event, EventSink<T> sink) {
if (event.method == method) {
sink.add(transformer(event));
}
},
).bind(connection.onNotification),
)
.cast();
}