Accumulated Operator
Rocket.accumulated — Function
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 the type of the 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] CompletedSee also: AbstractOperator, InferableOperator, ProxyObservable, logger
Description
Combines all values emitted by the source, using an accumulator function that joins a new source value with all past emitted values into a single array. This is similar to scan with a vcat accumulation function.