Evit packages documentation
    Preparing search index...

    Interface Action<P, T>

    Represents a typed event-like action with an associated payload and tag.

    interface Action<P, T> {
        on: (fn: EventHandler<P, Action<P, T>>) => () => void;
        tag: T;
        (payload: P): void;
    }

    Type Parameters

    • P

      The payload type.

    • T

      A tag used to identify the action.

    • Triggers the action with the given payload.

      Parameters

      • payload: P

        The payload to send with the action.

      Returns void

    Index

    Properties

    Properties

    on: (fn: EventHandler<P, Action<P, T>>) => () => void

    Subscribes a handler to this action.

    Type declaration

    tag: T

    A unique tag used to identify this action.