kvision / pl.treksoft.kvision.state / ObservableSetWrapper

ObservableSetWrapper

(js) class ObservableSetWrapper<T> : MutableSet<T>, ObservableSet<T>, ObservableState<Set<T>>

Simple observable set implementation.

Constructors

(js)

<init>

Simple observable set implementation.

ObservableSetWrapper(mutableSet: MutableSet<T> = mutableSetOf())

Properties

(js)

mutableSet

val mutableSet: MutableSet<T>
(js)

onUpdate

val onUpdate: MutableCollection<(MutableSet<T>) -> Unit>
(js)

size

val size: Int

Functions

(js)

add

fun add(element: T): Boolean
(js)

addAll

fun addAll(elements: Collection<T>): Boolean
(js)

clear

fun clear(): Unit
(js)

contains

fun contains(element: T): Boolean
(js)

containsAll

fun containsAll(elements: Collection<T>): Boolean
(js)

getState

Get current state.

fun getState(): Set<T>
(js)

isEmpty

fun isEmpty(): Boolean
(js)

iterator

fun iterator(): MutableIterator<T>
(js)

remove

fun remove(element: T): Boolean
(js)

removeAll

fun removeAll(elements: Collection<T>): Boolean
(js)

retainAll

fun retainAll(elements: Collection<T>): Boolean
(js)

subscribe

Subscribe for the state change notifications.

fun subscribe(observer: (Set<T>) -> Unit): () -> Unit

Extension Properties

(js)

stateFlow

Extension property returning StateFlow for an ObservableState.

val <S> ObservableState<S>.stateFlow: StateFlow<S>