Accumulated Operator

Rocket.accumulatedFunction
accumulated()

Creates an accumulated operator, which returns an Observable that emits the current item with all of the previous items emitted by the source Observable in one single ordered array.

Producing

Stream of type <: Subscribable{Vector{L}} where L refers to type of source stream

Examples

using Rocket

source = from([ 1, 2, 3 ])
subscribe!(source |> accumulated(), logger())
;

# output

[LogActor] Data: [1]
[LogActor] Data: [1, 2]
[LogActor] Data: [1, 2, 3]
[LogActor] Completed
using Rocket

source = of(1)
subscribe!(source |> accumulated(), logger())
;

# output

[LogActor] Data: [1]
[LogActor] Completed

See also: AbstractOperator, InferableOperator, ProxyObservable, logger

source

Description

Combines all values emitted by the source, using an accumulator function that joins a new source value with the all past values emmited into one single array. This is similar to scan with vcat accumulation function.

See also

Operators