ref

fun <TElement : Element> ref(vararg keys: Any?, handle: (TElement) -> Unit): ElementRefScope<TElement>(source)

Create a trivial ref listener where you're informed about when a raw element is added to the DOM tree.

For example:

ref { element ->
  println("${element.localName} was added to the dom.")
}

Parameters

keys

Any number of keys which, if any change, will cause the effect to be disposed and restarted.

See also