Function shift

  • Experimental

    Construct an Observable using a (delimited) continuation-passing idiom.

    Type Parameters

    • A

    Parameters

    • fn: ((k) => void)

      A function whose argument is a delimited continuation.

        • (k): void
        • Parameters

          • k: ((value) => unknown)
              • (value): unknown
              • Parameters

                • value: A

                Returns unknown

          Returns void

    Returns Observable<A>

    An Observable.

    Example

    shift(times2 => {
    const six = times2(3);
    void times2(six);
    }).subscribe(
    (three_then_six: number): number => {
    console.log(`three_then_six = ${three_then_six}`);
    return three_then_six * 2;
    }
    );

    Example

    # prints
    three_then_six = 3
    three_then_six = 6

Generated using TypeDoc