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.

    • Optionaloptions: IStaticHandlerParams<Data>

      The options for the static handler.

      Interface defining the properties of the IStaticHandlerParams class.

      • Optionalfallback?: (e: Error) => void
      • OptionalonLoadBegin?: () => void
      • OptionalonLoadEnd?: (isOk: boolean) => void
      • OptionalresultMap?: (json: null | Record<string, any>) => null | Data

    Returns OneHandler<Data, Payload>

    • The static handler function.