# androidx.compose.runtime.snapshots.tooling

Common/All

## Interfaces

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/tooling/SnapshotObserver` | An observer for the snapshot system that notifies an observer when a snapshot is created, applied, and/or disposed. | Cmn |

## Classes

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/tooling/SnapshotInstanceObservers` | The return result of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/tooling/SnapshotObserver#onPreCreate(androidx.compose.runtime.snapshots.Snapshot,kotlin.Boolean)` allowing the reads and writes performed in the newly created snapshot to be observed | Cmn |

## Extension functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/ObserverHandle` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/ExperimentalComposeRuntimeApi https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/Snapshot.Companion.https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/tooling/package-summary#(androidx.compose.runtime.snapshots.Snapshot.Companion).observeSnapshots(androidx.compose.runtime.snapshots.tooling.SnapshotObserver)( snapshotObserver: https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/tooling/SnapshotObserver )` 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. | Cmn |

## Extension functions

### Snapshot.Companion.observeSnapshots

Cmn Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/snapshots/tooling/SnapshotObserver.kt+function:observeSnapshots) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.8.0)

```
@ExperimentalComposeRuntimeApi
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 `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/ObserverHandle#dispose()` on the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/ObserverHandle` returned is also thread-safe.

| Parameters |
|---|---|
| `snapshotObserver: https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/tooling/SnapshotObserver` | the snapshot observer to install. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/ObserverHandle` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/ObserverHandle` an instance to unregister the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/tooling/package-summary#(androidx.compose.runtime.snapshots.Snapshot.Companion).observeSnapshots(androidx.compose.runtime.snapshots.tooling.SnapshotObserver)`. |