MutableReactiveSet

A mutable set that also exposes a StateFlow via asStateFlow, allowing for reactive observation of its contents.

It delegates MutableSet functionality to an internal set and emits an immutable Set snapshot to its collectors whenever the set is modified.

Parameters

E

The type of elements contained in the set.

Properties

Link copied to clipboard
abstract override val size: Int

Functions

Link copied to clipboard
abstract override fun add(element: E): Boolean
Link copied to clipboard
abstract override fun addAll(elements: Collection<E>): Boolean
Link copied to clipboard
abstract fun asStateFlow(): StateFlow<Set<E>>

Returns the collection's content as a StateFlow of an immutable collection IC type.

Link copied to clipboard
abstract fun batchUpdate(block: MutableSet<E>.() -> Unit)

Executes a block of modifications on the underlying mutable collection and notifies observers only once after the block has completed.

Link copied to clipboard
abstract suspend fun batchUpdateAsync(block: suspend MutableSet<E>.() -> Unit)

Executes a suspending block of modifications on the underlying mutable collection and notifies observers only once after the block has completed.

Link copied to clipboard
abstract override fun clear()
Link copied to clipboard
abstract operator override fun contains(element: E): Boolean
Link copied to clipboard
abstract override fun containsAll(elements: Collection<E>): Boolean
Link copied to clipboard
abstract override fun isEmpty(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): MutableIterator<E>
Link copied to clipboard
abstract override fun remove(element: E): Boolean
Link copied to clipboard
abstract override fun removeAll(elements: Collection<E>): Boolean
Link copied to clipboard
abstract override fun retainAll(elements: Collection<E>): Boolean
Link copied to clipboard

Returns a new MutableReactiveList filled with all elements of this collection.

Link copied to clipboard

Returns a new MutableReactiveSet filled with all elements of this collection.