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

    Function flip

    • Flips two arguments of the function.

      Type Parameters

      • T
      • U
      • V

      Parameters

      • f: Fn<T, Fn<U, V>>

        The function with two arguments.

      Returns Fn<U, Fn<T, V>>

      The function flipped the arguments.

      Examples

      const fn = flip((a: string) => (b: string) => a + b);
      expect(fn("a")("b")).toStrictEqual("ba");
      expect(fn("asd")("btg")).toStrictEqual("btgasd");