Annotates the input stream using ReactiveOp as the source of annotations. The output values will have the shape of { value: TIn, annotation: TAnnotation }. Meaning that the original value is stored under .value, and the annotation under .annotation.
{ value: TIn, annotation: TAnnotation }
.value
.annotation
const data = Rx.From.array([ 1, 2, 3 ]);const annotated = Rx.Ops.annotateWithOp(data, Rx.Ops.sum());const data = await annotated.toArray(annotated);// Data = [ { value: 1, annotation: 1 }, { value: 2, annotation: 3 }, { value: 3, annotation: 6 } ] Copy
const data = Rx.From.array([ 1, 2, 3 ]);const annotated = Rx.Ops.annotateWithOp(data, Rx.Ops.sum());const data = await annotated.toArray(annotated);// Data = [ { value: 1, annotation: 1 }, { value: 2, annotation: 3 }, { value: 3, annotation: 6 } ]
Input stream
Operator to generate annotations
Annotates the input stream using ReactiveOp as the source of annotations. The output values will have the shape of
{ value: TIn, annotation: TAnnotation }
. Meaning that the original value is stored under.value
, and the annotation under.annotation
.