# DisposableState

Artifact: [androidx.appstate.transform:transform](https://developer.android.com/jetpack/androidx/releases/appstate-transform) [View Source](https://cs.android.com/search?q=file:androidx/appstate/transform/DisposableState.kt+class:androidx.appstate.transform.DisposableState) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/appstate-transform#1.0.0-alpha02) Common/All
- Cmn

  ```
  interface DisposableState<T : Any?> : State<T>
  ```

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/compose/runtime/State` that can be disposed to stop its underlying state transformation.

This is meant to be returned from a `https://developer.android.com/reference/kotlin/androidx/appstate/transform/package-summary#transform(kotlin.Any,kotlinx.coroutines.CoroutineScope,kotlinx.coroutines.CoroutineDispatcher,kotlin.Function1)`.

| Parameters |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>` | The type of data held by this state. |

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/appstate/transform/DisposableState#dispose()()` Disposes this state. | Cmn |

### Inherited properties

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

## Public functions

### dispose

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

```
fun dispose(): Unit
```

Disposes this state.

In the context of a transform, this will remove it from the `https://developer.android.com/reference/kotlin/androidx/appstate/transform/TransformScope` and prevent it from getting any further updates.