Observable<T>.eventTransformed constructor

  1. Stream<T> source,
  2. EventSink<T> mapSink(
    1. 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.


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