@mikuroxina/mini-fn
    Preparing search index...

    Function compose

    • Composes two functions mathematically. compose(f)(g)(x) means f(g(x)).

      Type Parameters

      • U
      • V

      Parameters

      • f: Fn<U, V>

        The function to do at last.

      Returns <T>(g: Fn<T, U>) => (t: T) => V

      The composed function.

      Examples

      expect(compose((x: number) => x + 1)((x: number) => x * 2)(3)).toStrictEqual(7);