whenVisible

Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.when

Monitor an HTMLElement to be notified when it is visible

Params

  1. $elm*-HTMLElement

    The element to monitor

Return

  1. -(Promise<HTMLElement>)

    The promise that will be resolved when the element is visible

Example

import { whenVisible } from '@blackbyte/sugar/dom'
whenVisible(myCoolHTMLElement).then(($elm) => {
  // do something with your element that is now visible
});

Todo

  • testsnormal