<div class='type'>Function</div>


<a id='references'></a>


<h2 id="mutablestateof-value-policy">mutableStateOf</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
@StateFactoryMarker
public fun <T> mutableStateOf(
    value: T,
    policy: SnapshotMutationPolicy<T> = structuralEqualityPolicy(),
): MutableState<T>
```


Return a new `MutableState` initialized with the passed in `value`

The MutableState class is a single value holder whose reads and writes are observed by Compose.
Additionally, writes to it are transacted as part of the `Snapshot` system.

#### Parameters

| | |
| --- | --- |
| value | the initial value for the `MutableState` |
| policy | a policy to controls how changes are handled in mutable snapshots. |