🌈 Create new beautiful Compose Gradients with our new wesite ->
Function

observeSnapshots

This is a tooling API and is not intended to be used in a production application as it will introduce global overhead to creating, applying and disposing all snapshots and, potentially, to reading and writing all state objects.

observeSnapshots

Source set: Common
public fun Snapshot.Companion.observeSnapshots(snapshotObserver: SnapshotObserver): ObserverHandle

This is a tooling API and is not intended to be used in a production application as it will introduce global overhead to creating, applying and disposing all snapshots and, potentially, to reading and writing all state objects.

Observe when snapshots are created, applied, and/or disposed. The observer can also install read and write observers on the snapshot being created.

This method is thread-safe and calling ObserverHandle.dispose on the ObserverHandle returned is also thread-safe.

Parameters

snapshotObserver the snapshot observer to install.

Return

ObserverHandle an instance to unregister the snapshotObserver.