# SnapshotMutableState

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/SnapshotMutableState.kt+class:androidx.compose.runtime.snapshots.SnapshotMutableState) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.0.0) Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  interface SnapshotMutableState<T : Any?> : MutableState<T>
  ```

*** ** * ** ***

A mutable value holder where reads to the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/SnapshotMutableState#value()` property during the execution of a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable` function, the current `https://developer.android.com/reference/kotlin/androidx/compose/runtime/RecomposeScope` will be subscribed to changes of that value. When the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/SnapshotMutableState#value()` property is written to and changed, a recomposition of any subscribed `https://developer.android.com/reference/kotlin/androidx/compose/runtime/RecomposeScope`s will be scheduled. Writes to it are transacted as part of the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/Snapshot` system.

In general for correctness: Anything that is mutable, that is read during composition or written to during composition, should be a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/SnapshotMutableState`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/MutableState` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#mutableStateOf(kotlin.Any,androidx.compose.runtime.SnapshotMutationPolicy)` |   |

## Summary

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SnapshotMutationPolicy<T>` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/SnapshotMutableState#policy()` A policy to control how changes are handled in a mutable snapshot. | Cmn |

### Inherited functions

From [androidx.compose.runtime.MutableState](https://developer.android.com/reference/kotlin/androidx/compose/runtime/MutableState) `operator T` `https://developer.android.com/reference/kotlin/androidx/compose/runtime/MutableState#component1()()` Cmn `operator (T) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/runtime/MutableState#component2()()` Cmn

### Inherited properties

From [androidx.compose.runtime.MutableState](https://developer.android.com/reference/kotlin/androidx/compose/runtime/MutableState) `T` `https://developer.android.com/reference/kotlin/androidx/compose/runtime/MutableState#value()` Cmn

## Public properties

### policy

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.0.0)

```
val policy: SnapshotMutationPolicy<T>
```

A policy to control how changes are handled in a mutable snapshot.