class ObservableListWrapper<T> : MutableList<T>, ObservableList<T>, ObservableState<List<T>>
Simple observable list implementation.
ObservableListWrapper(mutableList: MutableList<T> = mutableListOf())
Simple observable list implementation. |
val mutableList: MutableList<T> |
|
val onUpdate: MutableCollection<(MutableList<T>) -> Unit> |
|
val size: Int |
fun add(element: T): Boolean fun add(index: Int, element: T): Unit |
|
fun addAll(elements: Collection<T>): Boolean fun addAll(index: Int, elements: Collection<T>): Boolean |
|
fun clear(): Unit |
|
fun contains(element: T): Boolean |
|
fun containsAll(elements: Collection<T>): Boolean |
|
fun get(index: Int): T |
|
fun getState(): List<T>
Get current state. |
|
fun indexOf(element: T): Int |
|
fun isEmpty(): Boolean |
|
fun iterator(): MutableIterator<T> |
|
fun lastIndexOf(element: T): Int |
|
fun listIterator(): MutableListIterator<T> fun listIterator(index: Int): MutableListIterator<T> |
|
fun remove(element: T): Boolean |
|
fun removeAll(elements: Collection<T>): Boolean |
|
fun removeAt(index: Int): T |
|
fun retainAll(elements: Collection<T>): Boolean |
|
fun set(index: Int, element: T): T |
|
fun subList(fromIndex: Int, toIndex: Int): MutableList<T> |
|
fun subscribe(observer: (List<T>) -> Unit): () -> Unit
Subscribe for the state change notifications. |
fun <T> Any?.createInstance(vararg args: dynamic): T
Helper function for creating JavaScript objects from dynamic constructors. |
|
fun <T> MutableList<T>.syncWithList(list: List<T>): Unit
Utility extension function to synchronise elements of the MutableList. |