Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Function1<T, U>

Function1 encapsulates a function taking a single parameter and returning a value. It adds some useful functions to combine or transform functions.

Type parameters

  • T

    the parameter type

  • U

    the result type

Hierarchy

  • Function1

Callable

  • __call(x: T): U
  • Invoke the function

    Parameters

    • x: T

    Returns U

Index

Methods

Methods

andThen

  • Returns a new composed function which first applies the current function and then the one you pass as parameter.

    Type parameters

    • V

    Parameters

    • fn: function
        • (x: U): V
        • Parameters

          • x: U

          Returns V

    Returns Function1<T, V>

compose

  • Type parameters

    • S

    Parameters

    • fn: function
        • (x: S): T
        • Parameters

          • x: S

          Returns T

    Returns Function1<S, U>

Generated using TypeDoc