Multi Selection Store
This store can be used for components with an internal store that has to deal with a List of some type T.
Use the toggle method to add or remove a selected item from the current selection:
val selection = MultiSelectionStore<String>()
lineUp {
items {
listOf("One", "Two", "Three", "Four", "Five").forEach { value ->
box({
background { color { info } }
}) {
+value
clicks.events.map { value } handledBy selection.toggle
// ^^^^^ ^^^^^^
// pass current value to the ``toggle`` handler!
}
}
}
}
div {
+"Selection:"
ul {
selection.data.renderEach { value ->
li { +value }
}
}
}
RFC: Never ever expose the internal store directly to the client side! Only accept values or Flow]s and return those in order to exchange data with the client!
Constructors
MultiSelectionStore
Link copied to clipboard
fun MultiSelectionStore()
Content copied to clipboard
Functions
errorHandler
Link copied to clipboard
handle
Link copied to clipboard
handledBy
Link copied to clipboard
open infix fun <E : Event, X : Element> DomListener<E, X>.handledBy(handler: Handler<Unit>)
Content copied to clipboard
open infix fun <E : Event, X : Element> DomListener<E, X>.handledBy(execute: suspend (E) -> Unit): Job
Content copied to clipboard
open infix fun <E : Event> WindowListener<E>.handledBy(handler: Handler<Unit>)
Content copied to clipboard