Interface mainHook<T>

wrapped local Hook embedded struct to limit the public API surface.

Type Parameters

  • T

Hierarchy

Methods

  • Add registers a new handler to the hook by appending it to the existing queue.

    Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id).

    Parameters

    Returns string

  • PreAdd registers a new handler to the hook by prepending it to the existing queue.

    Returns an autogenerated hook id that could be used later to remove the hook with Hook.Remove(id).

    Parameters

    Returns string

  • Remove removes a single hook handler by its id.

    Parameters

    • id: string

    Returns void

  • RemoveAll removes all registered handlers.

    Returns void

  • Trigger executes all registered hook handlers one by one with the specified data as an argument.

    Optionally, this method allows also to register additional one off handlers that will be temporary appended to the handlers queue.

    The execution stops when:

    • hook.StopPropagation is returned in one of the handlers
    • any non-nil error is returned in one of the handlers

    Parameters

    Returns void

Generated using TypeDoc