Tiny wrapper around ResizeObserver used to execute callbacks when given HTMLElement size changes.

Constructors

Properties

shouldWatch: boolean

Whether we should add elements to our resizeObserver or not

Array of entries

resizeObserver: ResizeObserver

ResizeObserver used

Methods

  • Set shouldWatch

    Parameters

    • shouldWatch: boolean = true

      whether to watch or not

    Returns void

  • Unobserve an HTMLElement and remove it from our entries array

    Parameters

    • element: Element | HTMLElement

      HTMLElement to unobserve

    Returns void