MapTo Operator
Rocket.map_to
— Functionmap_to(value::T) where T
Creates a map operator, which emits the given constant value on the output Observable every time the source Observable emits a value.
Arguments
value::T
: the constant value to map each source value to
Producing
Stream of type <: Subscribable{T}
Examples
using Rocket
source = from([ 1, 2, 3 ])
subscribe!(source |> map_to('a'), logger())
;
# output
[LogActor] Data: a
[LogActor] Data: a
[LogActor] Data: a
[LogActor] Completed
See also: map
, AbstractOperator
, RightTypedOperator
, ProxyObservable
, logger
Description
Takes a constant value as argument, and emits that whenever the source Observable emits a value. In other words, ignores the actual source value, and simply uses the emission moment to know when to emit the given value.