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

    Function withCont

    • Applies the function to transform the continuation passed to the computation.

      Examples

      Type Parameters

      • A
      • B
      • R

      Parameters

      • callback: (fn: (b: B) => R) => (a: A) => R

      Returns (cont: Cont.Cont<R, A>) => Cont.Cont<R, B>

      const cont = withCont((fn: (x: number) => boolean) => (a: string) =>
      fn(parseInt(a, 10))
      )(
      (callback) => callback("foo"),
      );
      const actual = runCont(cont)(Number.isNaN);
      expect(actual).toStrictEqual(true);