Function cancelIfUndefined

  • Cancels the remaining flow operations if undefined is an input. See also ifUndefined or ifNotUndefined.

    const c3 = Process.flow(
    Basic.max(),
    Process.seenLastToUndefined(),
    Process.cancelIfUndefined(),
    (v => {
    console.log(v);
    })
    );
    c3(100); // Prints '100'
    c3(90); // Doesn't print anything since max does not change
    c3(110); // Prints '110'

    Type Parameters

    • TIn

    Returns ((value: undefined | TIn) => TIn)

      • (value): TIn
      • Parameters

        • value: undefined | TIn

        Returns TIn