Function annotateWithOp

  • 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.

    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 } ]

    Type Parameters

    • In
    • TAnnotation

    Parameters

    Returns Reactive<{
        annotation: TAnnotation;
        value: In;
    }>