SnapshotStateObserver

class SnapshotStateObserver(onChangedExecutor: (callback: () -> Unit) -> Unit)

Functions

clear
Link copied to clipboard
common
fun clear()
Remove all observations.
fun clear(target: Any)
Clears all model read observations for a given target.
dispose
Link copied to clipboard
common
fun dispose()
Remove all hooks used to track changes.
enableStateUpdatesObserving
Link copied to clipboard
common
fun enableStateUpdatesObserving(enabled: Boolean)
Starts or stops watching for model commits based on enabled.
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
notifyChanges
Link copied to clipboard
common
fun notifyChanges(changes: Set<Any>, snapshot: Snapshot)
This method is only used for testing.
observeReads
Link copied to clipboard
common
fun <T : Any> observeReads(target: T, onChanged: (T) -> Unit, block: () -> Unit)
Executes block, observing state object reads during its execution.
pauseObservingReads
Link copied to clipboard
common
fun pauseObservingReads(block: () -> Unit)
Stops observing state object reads while executing block.
removeObservationsFor
Link copied to clipboard
common
fun removeObservationsFor(predicate: (scope: Any) -> Boolean)
Remove observations using predicate to identify target scopes to be removed.
toString
Link copied to clipboard
common
open fun toString(): String