# MutatePriority

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/MutatorMutex.kt+class:androidx.compose.foundation.MutatePriority) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  enum MutatePriority : Enum<MutatePriority>
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)\<[MutatePriority](https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority)\> ||
|   | ↳ | [androidx.compose.foundation.MutatePriority](https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority) |

*** ** * ** ***

Priorities for performing mutation on state.

`https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority` values follow the natural ordering of `enum class` values; a value that compares as `>` to another has a higher priority. A mutation of equal or greater priority will interrupt the current mutation in progress.

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#Default` | The default priority for mutations. |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#PreventUserInput` | A high-priority mutation that can only be interrupted by other `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#PreventUserInput` priority operations. |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#UserInput` | An elevated priority for mutations meant for implementing direct user interactions. |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority>` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#values()()` Returns an array containing the constants of this enum type, in the order they're declared. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority>` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. | Cmn |

## Enum Values

### Default

```
val MutatePriority.Default: MutatePriority
```

The default priority for mutations. Can be interrupted by other `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#Default`, `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#UserInput` or `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#PreventUserInput` priority operations. `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#Default` priority should be used for programmatic animations or changes that should not interrupt user input.

### PreventUserInput

```
val MutatePriority.PreventUserInput: MutatePriority
```

A high-priority mutation that can only be interrupted by other `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#PreventUserInput` priority operations. `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#PreventUserInput` priority should be used for operations that user input should not be able to interrupt.

### UserInput

```
val MutatePriority.UserInput: MutatePriority
```

An elevated priority for mutations meant for implementing direct user interactions. Can be interrupted by other `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#UserInput` or `https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority#PreventUserInput` priority operations.

## Public functions

### valueOf

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

```
fun valueOf(value: String): MutatePriority
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### values

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

```
fun values(): Array<MutatePriority>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

## Public properties

### entries

Cmn

```
val entries: EnumEntries<MutatePriority>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.