StateStore

class StateStore<T, I>(sortingPlanReducer: SortingPlanReducer) : RootStore<State>

Store for the column configuration that holds a State object. It does not manage the actual data of the table; this is done by RowSelectionStore!

Currently only one handler (sortingChanged) is offered, that calculates the new SortingPlan based upon the selected Column-Id and its Sorting strategy. The required SortingPlanReducer is used to to the actual calculation.

On top there are some helper functions, that produces the needed Flows of data for the different rendering aspects: One for the header, one for the rows and one for the cells of a row.

Constructors

StateStore
Link copied to clipboard
js
fun StateStore(sortingPlanReducer: SortingPlanReducer)

Functions

enqueue
Link copied to clipboard
js
open suspend override fun enqueue(update: QueuedUpdate<State>)
errorHandler
Link copied to clipboard
js
open fun errorHandler(exception: Throwable, oldValue: State): State
handle
Link copied to clipboard
js
open fun handle(errorHandler: ErrorHandler<State>, execute: suspend (State) -> State): SimpleHandler<Unit>
open fun <A> handle(errorHandler: ErrorHandler<State>, execute: suspend (State, A) -> State): SimpleHandler<A>
handleAndEmit
Link copied to clipboard
js
open fun <E> handleAndEmit(errorHandler: ErrorHandler<State>, execute: suspend FlowCollector<E>.(State) -> State): EmittingHandler<Unit, E>
open fun <A, E> handleAndEmit(errorHandler: ErrorHandler<State>, execute: suspend FlowCollector<E>.(State, A) -> State): 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, X : Element> DomListener<E, X>.handledBy(execute: suspend (E) -> Unit): Job
open infix fun <E : Event> WindowListener<E>.handledBy(handler: Handler<Unit>)
open infix fun <E : Event> WindowListener<E>.handledBy(execute: suspend (E) -> Unit): Job
open infix fun <A> Flow<A>.handledBy(handler: Handler<A>)
open infix fun <A> Flow<A>.handledBy(execute: suspend (A) -> Unit): Job
renderingHeaderData
Link copied to clipboard
js
fun renderingHeaderData(component: DataTableComponent<T, I>): Flow<List<Pair<Column<T>, ColumnIdSorting>>>
renderingRowsData
Link copied to clipboard
js
fun renderingRowsData(component: DataTableComponent<T, I>, rowIdProvider: (T) -> I): Flow<Pair<List<IndexedValue<T>>, Map<I, List<Pair<Column<T>, IndexedValue<StatefulItem<T>>>>>>>
sub
Link copied to clipboard
js
open fun <X> sub(lens: Lens<State, X>): SubStore<State, X>
syncBy
Link copied to clipboard
js
open fun syncBy(handler: Handler<State>)
open fun syncBy(handler: Handler<Unit>)
syncWith
Link copied to clipboard
js
open fun <I> syncWith(socket: Socket, resource: Resource<State, I>)

Properties

current
Link copied to clipboard
js
open override val current: State
data
Link copied to clipboard
js
open override val data: Flow<State>
id
Link copied to clipboard
js
open override val id: String
job
Link copied to clipboard
js
open override val job: Job
path
Link copied to clipboard
js
open override val path: String
sortingChanged
Link copied to clipboard
js
val sortingChanged: SimpleHandler<ColumnIdSorting>
update
Link copied to clipboard
js
open override val update: SimpleHandler<State>