refScope
fun <TElement : Element> refScope(init: ElementRefScope.Builder<TElement>.() -> Unit): ElementRefScope<TElement>(source)
Create a scope which lets you specify any number of ref and disposableRef handlers.
This can be useful if you might have one element that must be rebuilt in response to two different keys independently.
For example:
refScope {
ref(isFeature1Enabled) {
println("Element was initialized, possibly due to feature1's setting changing.")
}
ref(isFeature2Enabled) {
println("Element was initialized, possibly due to feature2's setting changing.")
}
}
Content copied to clipboard