Function dispatch

  • Creates a new dispatch for the specified event types. Each type is a string, such as "start" or "end".

    Type Parameters

    • T extends object

    Parameters

    • Rest ...types: string[]

      The event types.

    Returns Dispatch<T>

    Throws

    "illegal type" on empty string or duplicated event types.