ObservableListWrapper

class ObservableListWrapper<T>(val mutableList: MutableList<T> = mutableListOf()) : MutableList<T> , ObservableList<T> , ObservableState<List<T>>

Simple observable list implementation.

Constructors

Link copied to clipboard
constructor(mutableList: MutableList<T> = mutableListOf())

Properties

Link copied to clipboard
Link copied to clipboard
open override val onUpdate: MutableCollection<(MutableList<T>) -> Unit>
Link copied to clipboard
open override val size: Int
Link copied to clipboard
val <S> ObservableState<S>.stateFlow: <Error class: unknown class><S>

Extension property returning a StateFlow for an ObservableState.

Functions

Link copied to clipboard
open override fun add(element: T): Boolean
open override fun add(index: Int, element: T)
Link copied to clipboard
open override fun addAll(elements: Collection<T>): Boolean
open override fun addAll(index: Int, elements: Collection<T>): Boolean
Link copied to clipboard
open override fun clear()
Link copied to clipboard
open operator override fun contains(element: T): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<T>): Boolean
Link copied to clipboard
open operator override fun get(index: Int): T
Link copied to clipboard
open override fun getState(): List<T>

Get current state.

Link copied to clipboard
open override fun indexOf(element: T): Int
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): MutableIterator<T>
Link copied to clipboard
open override fun lastIndexOf(element: T): Int
Link copied to clipboard
open override fun listIterator(): MutableListIterator<T>
open override fun listIterator(index: Int): MutableListIterator<T>
Link copied to clipboard
fun List<String>.pairs(): List<<Error class: unknown class><String, String>>

Utility extension function to convert List into List.

Link copied to clipboard
open override fun remove(element: T): Boolean
Link copied to clipboard
open override fun removeAll(elements: Collection<T>): Boolean
Link copied to clipboard
open override fun removeAt(index: Int): T
Link copied to clipboard
open override fun retainAll(elements: Collection<T>): Boolean
Link copied to clipboard
open operator override fun set(index: Int, element: T): T
Link copied to clipboard
fun <S, T> ObservableState<S>.sub(contextWidget: Widget? = null, extractor: (S) -> T): ObservableState<T>

Returns a sub-store of the original ObservableState

Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): MutableList<T>
Link copied to clipboard
open override fun subscribe(observer: (List<T>) -> Unit): () -> Unit

Subscribe for the state change notifications. Calls the observer with the current state.

Link copied to clipboard
fun <T> MutableList<T>.syncWithList(list: List<T>)

Utility extension function to synchronise elements of the MutableList.