Function useCatch

  • A custom hook that receives an injectable function and a catcher function that handles any thrown error. It returns a modified version of the injectable function that catches any errors thrown and passes them to the catcher function.

    Type Parameters

    • E extends Error

    • AF extends AsyncFunc

    Parameters

    • injectableFn: AF

      The original function to be modified.

    • catcher: ((e) => R<AF>)

      A function that handles any error thrown.

        • (e): R<AF>
        • Parameters

          • e: E

          Returns R<AF>

    Returns void

    This function does not return anything.

Generated using TypeDoc