Hierarchy

  • SideEffectManager

Constructors

Properties

disposers: Map<string, SideEffectDisposer> = ...

All disposers. Use this only when you know what you are doing.

push: ((disposer: SideEffectDisposer | SideEffectDisposer[], disposerID?: string) => string) = ...

Type declaration

Methods

  • Sugar for addEventListener.

    Returns

    disposerID

    Type Parameters

    • K extends keyof WindowEventMap

    Parameters

    • el: Window
    • type: K
    • listener: ((this: Window, ev: WindowEventMap[K]) => unknown)
        • (this: Window, ev: WindowEventMap[K]): unknown
        • Parameters

          • this: Window
          • ev: WindowEventMap[K]

          Returns unknown

    • Optional options: boolean | AddEventListenerOptions
    • Optional disposerID: string

      Optional id for the disposer

    Returns string

  • Type Parameters

    • K extends keyof DocumentEventMap

    Parameters

    • el: Document
    • type: K
    • listener: ((this: Document, ev: DocumentEventMap[K]) => unknown)
        • (this: Document, ev: DocumentEventMap[K]): unknown
        • Parameters

          • this: Document
          • ev: DocumentEventMap[K]

          Returns unknown

    • Optional options: boolean | AddEventListenerOptions
    • Optional disposerID: string

    Returns string

  • Type Parameters

    • K extends keyof HTMLElementEventMap

    Parameters

    • el: HTMLElement
    • type: K
    • listener: ((this: HTMLElement, ev: HTMLElementEventMap[K]) => unknown)
        • (this: HTMLElement, ev: HTMLElementEventMap[K]): unknown
        • Parameters

          • this: HTMLElement
          • ev: HTMLElementEventMap[K]

          Returns unknown

    • Optional options: boolean | AddEventListenerOptions
    • Optional disposerID: string

    Returns string

  • Type Parameters

    • K extends "change"

    Parameters

    • el: MediaQueryList
    • type: K
    • listener: ((this: HTMLElement, ev: MediaQueryListEventMap[K]) => unknown)
        • (this: HTMLElement, ev: MediaQueryListEventMap[K]): unknown
        • Parameters

          • this: HTMLElement
          • ev: MediaQueryListEventMap[K]

          Returns unknown

    • Optional options: boolean | AddEventListenerOptions
    • Optional disposerID: string

    Returns string

  • Remove and run the disposer. Do nothing if not found.

    Parameters

    • disposerID: string

    Returns void

  • Sugar for setInterval.

    Returns

    disposerID

    Parameters

    • handler: (() => void)
        • (): void
        • Returns void

    • timeout: number
    • disposerID: string = ...

      Optional id for the disposer

    Returns string

  • Sugar for setTimeout.

    Returns

    disposerID

    Parameters

    • handler: (() => void)
        • (): void
        • Returns void

    • timeout: number
    • disposerID: string = ...

      Optional id for the disposer

    Returns string

Generated using TypeDoc