bind method

StreamChannel<S> bind(
  1. StreamChannel<T> channel
)

Transforms the events sent to and emitted by channel.

Creates a new channel. When events are passed to the returned channel's sink, the transformer will transform them and pass the transformed versions to channel.sink. When events are emitted from the channel.straem, the transformer will transform them and pass the transformed versions to the returned channel's stream.

Implementation

StreamChannel<S> bind(StreamChannel<T> channel) =>
    StreamChannel<S>.withCloseGuarantee(
        channel.stream.transform(_streamTransformer),
        _sinkTransformer.bind(channel.sink));