enumerate
enumerate
returns an Observable that converts each value emitted by the source Observable into a tuple of its order number and the value itself.
Get a value from the source with its order number
using Rocket
source = from([ 0.0, 0.2, 0.4, 0.6, 0.8, 1.0 ])
subscribe!(source |> enumerate(), logger())
# output
[LogActor] Data: (0.0, 1)
[LogActor] Data: (0.2, 2)
[LogActor] Data: (0.4, 3)
[LogActor] Data: (0.6, 4)
[LogActor] Data: (0.8, 5)
[LogActor] Data: (1.0, 6)
[LogActor] Completed
[Operators](@ref what_are_operators), [scan
](@ref operator_scan)