SingleSelectionStore

open class SingleSelectionStore : RootStore<Int?>

This store can be used for components with an internal store that has to deal with a single element selection from a collection of predefined values (like for a selectField or radioGroup component)

It is based upon the index of an item from the list represented by the Int type.

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

SingleSelectionStore
Link copied to clipboard
js
fun SingleSelectionStore()

Functions

enqueue
Link copied to clipboard
js
open suspend override fun enqueue(update: QueuedUpdate<Int?>)
equals
Link copied to clipboard
js
open operator fun equals(other: Any?): Boolean
errorHandler
Link copied to clipboard
js
open fun errorHandler(exception: Throwable, oldValue: Int?): Int?
handle
Link copied to clipboard
js
open fun handle(errorHandler: ErrorHandler<Int?>, execute: suspend (Int?) -> Int?): SimpleHandler<Unit>
open fun <A> handle(errorHandler: ErrorHandler<Int?>, execute: suspend (Int?, A) -> Int?): SimpleHandler<A>
handleAndEmit
Link copied to clipboard
js
open fun <E> handleAndEmit(errorHandler: ErrorHandler<Int?>, execute: suspend FlowCollector<E>.(Int?) -> Int?): EmittingHandler<Unit, E>
open fun <A, E> handleAndEmit(errorHandler: ErrorHandler<Int?>, execute: suspend FlowCollector<E>.(Int?, A) -> Int?): EmittingHandler<A, E>
handledBy
Link copied to clipboard
js
open infix fun <E : Event, X : Element> DomListener<E, X>.handledBy(handler: Handler<Unit>)
open infix fun <E : Event> WindowListener<E>.handledBy(handler: Handler<Unit>)
open infix fun <A> Flow<A>.handledBy(handler: Handler<A>)
hashCode
Link copied to clipboard
js
open fun hashCode(): Int
sub
Link copied to clipboard
js
fun <X> sub(lens: Lens<Int?, X>): SubStore<Int?, Int?, X>
syncBy
Link copied to clipboard
js
open fun syncBy(handler: Handler<Int?>)
open fun syncBy(handler: Handler<Unit>)
syncWith
Link copied to clipboard
js
open fun <I> syncWith(socket: Socket, resource: Resource<Int?, I>)
toString
Link copied to clipboard
js
open fun toString(): String

Properties

current
Link copied to clipboard
js
open override val current: Int?
data
Link copied to clipboard
js
open override val data: StateFlow<Int?>
id
Link copied to clipboard
js
open override val id: String
job
Link copied to clipboard
js
open override val job: Job
toggle
Link copied to clipboard
js
val toggle: EmittingHandler<Int, Int>
update
Link copied to clipboard
js
open override val update: SimpleHandler<Int?>