Observable<T>.eventTransformed constructor

Observable<T>.eventTransformed(Stream<T> source, EventSink<T> mapSink(EventSink<T> sink))

Creates an Observable where all events of an existing stream are piped through a sink-transformation.

The given mapSink closure is invoked when the returned stream is listened to. All events from the source are added into the event sink that is returned from the invocation. The transformation puts all transformed events into the sink the mapSink closure received during its invocation. Conceptually the mapSink creates a transformation pipe with the input sink being the returned EventSink and the output sink being the sink it received.

Implementation

factory Observable.eventTransformed(
        Stream<T> source, EventSink<T> mapSink(EventSink<T> sink)) =>
    Observable<T>((Stream<T>.eventTransformed(source, mapSink)));