class domkit::DomListener
sys::Obj domkit::DomListener
@Js
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.
- cur
-
static DomListener cur()
- onMount
-
Void onMount(Elem target, Func<Void,Elem> f)
Request callback when target node is mounted into document.
- onResize
-
Void onResize(Elem target, Func<Void,Elem> f)
Request callback when target node size has changed.
- onUnmount
-
Void onUnmount(Elem target, Func<Void,Elem> f)
Request callback when target node is unmounted from document.