Creates a new Sink from Scratch.
Creates a new Sink from Scratch. This function takes another function as its parameter that will be executed every time the Sink receives an emitted value.
the type parameter of the consumed elements.
the function to be executed on every emission
a Sink that consumes elements of type T.
Creates a Handler that is both Observable and Sink.
Creates a Handler that is both Observable and Sink.
An Observable with Sink is an Observable that can also receive Events, i.e. it’s both a Source and a Sink of events.
If you’re familiar with Rx, they’re very similar to Subjects.
This function also allows you to create initial values for your newly created Handler.
This is equivalent to calling startWithMany
with the given values.
the type parameter of the elements
a sequence of initial values that the Handler will emit.
the newly created Handler.
Creates a new sink.
Creates a new sink. This sink will transform the values it receives and then forward them along to the passed sink. The transformation is described by a function from an Observable to another Observable, i.e. an operator on Observable. This function applies the operator to the newly created sink and forwards the value to the original sink.
the type of the original sink
the type of the resulting sink
the Sink to forward values to
the operator to use
the resulting sink, that will forward the values
Creates two new sinks.
Creates two new sinks. These sinks will transform the values it receives and then forward them along to the passed sink.
The transformation is described by a function from two Observables to another Observable, i.e. an operator on Observable.
(e.g. merge
)
This function applies the operator to the newly created sinks and forwards the value to the original sink.
the type of the original sink
the type of the other of the resulting sinks
the type of one of the resulting sinks
the Sink to forward values to
the operator to use
the two resulting sinks, that will forward the values
Creates three new sinks.
Creates three new sinks. These sinks will transform the values it receives and then forward them along to the passed sink.
The transformation is described by a function from three Observables to another Observable, i.e. an operator on Observable.
(e.g. combineLatest
)
This function applies the operator to the newly created sinks and forwards the value to the original sink.
the type of the original sink
the type of one of the other of the resulting sinks
the type of the other of the resulting sinks
the type of one of the resulting sinks
the Sink to forward values to
the operator to use
the two resulting sinks, that will forward the values
Creates a new sink.
Creates a new sink. This sink will transform each value it receives and then forward it along to the passed sink.
The transformation is a simple map from one type to another, i.e. a 'map'.
This is equivalent to contramap
on a Contravariant
functor, since Sink
s are contravariant in nature.
the type of the original sink
the type of the resulting sink
the Sink to forward values to
the mapping to perform before forwarding
the resulting sink, that will forward the values