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 an 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 Flows 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