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

Link copied to clipboard
fun StateStore(sortingPlanReducer: SortingPlanReducer)

Functions

Link copied to clipboard
open suspend override fun enqueue(update: QueuedUpdate<State>)
Link copied to clipboard
open fun errorHandler(exception: Throwable, oldValue: State): State
Link copied to clipboard
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>
Link copied to clipboard
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>
Link copied to clipboard
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
Link copied to clipboard
fun renderingHeaderData(component: DataTableComponent<T, I>): Flow<List<Pair<Column<T>, ColumnIdSorting>>>
Link copied to clipboard
fun renderingRowsData(component: DataTableComponent<T, I>, rowIdProvider: (T) -> I): Flow<Pair<List<IndexedValue<T>>, Map<I, List<Pair<Column<T>, IndexedValue<StatefulItem<T>>>>>>>
Link copied to clipboard
open fun <X> sub(lens: Lens<State, X>): SubStore<State, X>
Link copied to clipboard
open fun syncBy(handler: Handler<State>)
open fun syncBy(handler: Handler<Unit>)
Link copied to clipboard
open fun <I> syncWith(socket: Socket, resource: Resource<State, I>)

Properties

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