• Wraps the return value of body into a Result over Promise.

    Type Parameters

    • E

    Parameters

    • catcher: ((err) => E)

      The function to cast an error from body.

        • (err): E
        • Parameters

          • err: unknown

          Returns E

    Returns (<A, R>(body) => ((...args) => Promise<Result<E, R>>))

    The wrapped function.

      • <A, R>(body): ((...args) => Promise<Result<E, R>>)
      • Type Parameters

        • A extends unknown[]

        • R

        Parameters

        • body: ((...args) => Promise<R>)
            • (...args): Promise<R>
            • Parameters

              • Rest ...args: A

              Returns Promise<R>

        Returns ((...args) => Promise<Result<E, R>>)

          • (...args): Promise<Result<E, R>>
          • Parameters

            • Rest ...args: A

            Returns Promise<Result<E, R>>

Generated using TypeDoc