type

DomListener

src @Js
class DomListener : Obj

DomListener monitors the DOM and invokes callbacks when modifications occur.

DomListener works by registering a global MutationObserver on the body tag and collects all childList events for his subtree. All mutation events are queued and processed on a reqAnimationFrame. Registered nodes are held with weak references, and will be garbage collected when out of scope.

methods

cur
onMount

Request callback when target node is mounted into document.

onResize

Request callback when target node size has changed.

onUnmount

Request callback when target node is unmounted from document.

Slot Details

cur

src static DomListener cur()

onMount

src Void onMount(Elem target, |Elem| f)

Request callback when target node is mounted into document.

onResize

src Void onResize(Elem target, |Elem| f)

Request callback when target node size has changed.

onUnmount

src Void onUnmount(Elem target, |Elem| f)

Request callback when target node is unmounted from document.