Function always

  • Returns a function that always returns the same value.

    Example

    const alwaysFoo = always("foo");
    const fillWithFoo = map(alwaysFoo);

    fillWithFoo([0, 1, 2]); // ["foo", "foo", "foo"]

    Returns

    Function that always return the given value.

    Type Parameters

    • Input

    Parameters

    • input: Input

    Returns (() => Input)

      • (): Input
      • Returns Input