Function useStaticHandler

Creates a static handler that wraps around an existing handler function.

  • Type Parameters

    • Data extends unknown = any

      The data type expected to be returned by the handler.

    • Payload = any

      The payload type expected to be passed to the handler.

    Parameters

    • handler: OneHandler<Data, Payload>

      The existing handler function.

    • options: IStaticHandlerParams<Data> = {}

      The options for the static handler.

    Returns OneHandler<Data, Payload>

    • The static handler function.