Amazon Vinyl
    Preparing search index...

    Class NetworkMetricsControllerImpl

    An object that may dispatch events and have handlers for those events. Similar to the DOM's EventTarget, this is a basic event system based on event naming.

    Some of the advantages of EventHost over EventTarget:

    • Not all supported platforms support EventTarget construction or extension.
    • EventTarget is designed for the DOM, with bubble and capture phases not necessary in Vinyl.
    • Event types are strict.
    • Events can be plain objects, no need to extend CustomEvent.
    • Easier unsubscription and disposal; reduces the risk of memory leaks.

    EventHost supports concurrent modification, that is, handlers may be added or removed during the execution of another handler.

    Hierarchy (View Summary)

    Implements

    Index
    logPrefix: string = ...

    A string prefix for all log statements made by this target.

    • Dispatches an event.

      Type Parameters

      • K extends "metricsChange"

      Parameters

      • type: K

        The key of the event within EventMap

      • event: NetworkMetricsEventMap[K]

        If the passed event is read-only, then it may be re-used/cached. Otherwise, it should be a new event object every dispatch. If no target property is set on the event, the target will be set to this host.

      Returns void