Function useLocalHandler

Executes a local handler function and manages the state of the data.

  • Type Parameters

    • Data extends unknown = any

      The type of the data that will be stored in the state.

    • Payload extends unknown = any

      The type of the payload that will be passed to the handler function.

    Parameters

    • handler: OneHandler<Data, Payload>

      The handler function to be executed.

    • options: ILocalHandlerParams<Data, any> = {}

      Additional options for the local handler.

    Returns ILocalHandlerResult<Data>

    • An object containing the data and a function to change the data.