---
title: "DisposableEffectScope"
description: "Receiver scope for [DisposableEffect] that offers the [onDispose] clause that should be the last
statement in any call to [DisposableEffect]."
type: "class"
---

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


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

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


```kotlin
public class DisposableEffectScope
```


Receiver scope for `DisposableEffect` that offers the `onDispose` clause that should be the last
statement in any call to `DisposableEffect`.


## Functions

```kotlin
public inline fun onDispose(crossinline onDisposeEffect: () -> Unit): DisposableEffectResult
```


Provide `onDisposeEffect` to the `DisposableEffect` to run when it leaves the composition or
its key changes.



