MapTo Operator

Rocket.map_toFunction
map_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

source

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.

See also

Operators