# SideEffect

Common/AllAndroid/JVMNative/C/iOSJavaScript

## Functions summary

|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable @https://developer.android.com/reference/kotlin/androidx/compose/runtime/NonRestartableComposable @https://developer.android.com/reference/kotlin/androidx/compose/runtime/ExplicitGroupsComposable https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Function0)(effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Function0)` to run when the current composition completes successfully and applies changes. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable @https://developer.android.com/reference/kotlin/androidx/compose/runtime/NonRestartableComposable https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Function0)(key1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Function0)` to run as a side effect for any new unique value of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Function0)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable @https://developer.android.com/reference/kotlin/androidx/compose/runtime/NonRestartableComposable https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Array,kotlin.Function0)(vararg keys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Array,kotlin.Function0)` to run as a side effect for any new unique `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Array,kotlin.Function0)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable @https://developer.android.com/reference/kotlin/androidx/compose/runtime/NonRestartableComposable https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)(key1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, key2: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)` to run as a side effect for any new unique value of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)` or `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable @https://developer.android.com/reference/kotlin/androidx/compose/runtime/NonRestartableComposable https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)(key1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, key2: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, key3: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` to run as a side effect for any new unique value of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`, or `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable @https://developer.android.com/reference/kotlin/androidx/compose/runtime/NonRestartableComposable https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)(key1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, key2: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, key3: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, key4: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` to run as a side effect for any new unique value of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` or `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`. | Cmn |

## Functions

### SideEffect

Cmn 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/Effects.kt+function:SideEffect) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.0.0)

```
@Composable
@NonRestartableComposable
@ExplicitGroupsComposable
fun SideEffect(effect: () -> Unit): Unit
```

Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Function0)` to run when the current composition completes successfully and applies changes. `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Function0)` can be used to apply side effects to objects managed by the composition that are not backed by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/snapshots/Snapshot` so as not to leave those objects in an inconsistent state if the current composition operation fails.

`https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Function0)` will always be run on the composition's apply dispatcher and appliers are never run concurrent with themselves, one another, applying changes to the composition tree, or running `https://developer.android.com/reference/kotlin/androidx/compose/runtime/RememberObserver` event callbacks. `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Function0)`s are always run after `https://developer.android.com/reference/kotlin/androidx/compose/runtime/RememberObserver` event callbacks.

A `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Function0)` runs after **every** recomposition when invoked without any keys. To only perform the effect once, use an overload of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Function0)` that accepts a key. To launch an ongoing task spanning potentially many recompositions, see `https://developer.android.com/reference/kotlin/androidx/compose/runtime/LaunchedEffect.composable#LaunchedEffect(kotlin.coroutines.SuspendFunction1)`. To manage an event subscription or other object lifecycle, see `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)`.

**Note:** For all overloads of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Function0)`, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Function0)` is executed *after* all `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)` and `https://developer.android.com/reference/kotlin/androidx/compose/runtime/RememberObserver` callbacks are dispatched. Effects are executed in the order that they appear in the composition hierarchy (following an in-order traversal).

### SideEffect

Cmn 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/Effects.kt+function:SideEffect) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.12.0)

```
@Composable
@NonRestartableComposable
fun SideEffect(key1: Any?, effect: () -> Unit): Unit
```

Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Function0)` to run as a side effect for any new unique value of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Function0)`.

A `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Function0)`'s *key* is a value that defines the identity of the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Function0)`. When a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Function0)` recomposes, its `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Function0)` will only execute if its `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Function0)` differs from the previously provided value.

When using the overload of this function that doesn't accept keys, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Function0)` will execute on every recomposition. This overload is preferred when you have one-shot work that doesn't require the coroutine afforded by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/LaunchedEffect.composable#LaunchedEffect(kotlin.coroutines.SuspendFunction1)`, or the disposal afforded by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)`.

**Note:** For all overloads of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Function0)`, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Function0)` is executed *after* all `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)` and `https://developer.android.com/reference/kotlin/androidx/compose/runtime/RememberObserver` callbacks are dispatched. Effects are executed in the order that they appear in the composition hierarchy (following an in-order traversal).

| Parameters |
|---|---|
| `key1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | A key input; if recomposed with a new value from the previous key, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Function0)` will be scheduled. |
| `effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The effect that will execute when this composition completes successfully and is applying changes. |

### SideEffect

Cmn 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/Effects.kt+function:SideEffect) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.12.0)

```
@Composable
@NonRestartableComposable
fun SideEffect(vararg keys: Any?, effect: () -> Unit): Unit
```

Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Array,kotlin.Function0)` to run as a side effect for any new unique `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Array,kotlin.Function0)`.

A `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Array,kotlin.Function0)`'s `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Array,kotlin.Function0)` are values that defines the identity of the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Array,kotlin.Function0)`. When a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Array,kotlin.Function0)` recomposes, its `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Array,kotlin.Function0)` will only execute if any of its keys differ from their previously provided value.

When using the overload of this function that doesn't accept keys, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Array,kotlin.Function0)` will execute on every recomposition. This overload is preferred when you have one-shot work that doesn't require the coroutine afforded by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/LaunchedEffect.composable#LaunchedEffect(kotlin.coroutines.SuspendFunction1)`, or the disposal afforded by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)`.

**Note:** For all overloads of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Array,kotlin.Function0)`, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Array,kotlin.Function0)` is executed *after* all `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)` and `https://developer.android.com/reference/kotlin/androidx/compose/runtime/RememberObserver` callbacks are dispatched. Effects are executed in the order that they appear in the composition hierarchy (following an in-order traversal).

| Parameters |
|---|---|
| `vararg keys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | Key inputs; if recomposed with a different list of keys, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Array,kotlin.Function0)` will be scheduled. |
| `effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The effect that will execute when this composition completes successfully and is applying changes. |

### SideEffect

Cmn 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/Effects.kt+function:SideEffect) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.12.0)

```
@Composable
@NonRestartableComposable
fun SideEffect(key1: Any?, key2: Any?, effect: () -> Unit): Unit
```

Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)` to run as a side effect for any new unique value of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)` or `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)`.

A `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)`'s *keys* are values that defines the identity of the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)`. When a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)` recomposes, its `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)` will only execute if any of its keys differ from their previously provided value.

When using the overload of this function that doesn't accept keys, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)` will execute on every recomposition. This overload is preferred when you have one-shot work that doesn't require the coroutine afforded by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/LaunchedEffect.composable#LaunchedEffect(kotlin.coroutines.SuspendFunction1)`, or the disposal afforded by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)`.

**Note:** For all overloads of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)`, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)` is executed *after* all `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)` and `https://developer.android.com/reference/kotlin/androidx/compose/runtime/RememberObserver` callbacks are dispatched. Effects are executed in the order that they appear in the composition hierarchy (following an in-order traversal).

| Parameters |
|---|---|
| `key1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | A key input; if recomposed with a new value from the previous key, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)` will be scheduled. |
| `key2: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | A second key input; if recomposed with a new value from the previous key, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Function0)` will be scheduled. |
| `effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The effect that will execute when this composition completes successfully and is applying changes. |

### SideEffect

Cmn 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/Effects.kt+function:SideEffect) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.12.0)

```
@Composable
@NonRestartableComposable
fun SideEffect(key1: Any?, key2: Any?, key3: Any?, effect: () -> Unit): Unit
```

Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` to run as a side effect for any new unique value of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`, or `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`.

A `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`'s *keys* are values that defines the identity of the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`. When a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` recomposes, its `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will only execute if any of its keys differ from their previously provided value.

When using the overload of this function that doesn't accept keys, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will execute on every recomposition. This overload is preferred when you have one-shot work that doesn't require the coroutine afforded by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/LaunchedEffect.composable#LaunchedEffect(kotlin.coroutines.SuspendFunction1)`, or the disposal afforded by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)`.

**Note:** For all overloads of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` is executed *after* all `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)` and `https://developer.android.com/reference/kotlin/androidx/compose/runtime/RememberObserver` callbacks are dispatched. Effects are executed in the order that they appear in the composition hierarchy (following an in-order traversal).

| Parameters |
|---|---|
| `key1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | A key input; if recomposed with a new value from the previous key, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will be scheduled. |
| `key2: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | A second key input; if recomposed with a new value from the previous key, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will be scheduled. |
| `key3: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | A third key input; if recomposed with a new value from the previous key, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will be scheduled. |
| `effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The effect that will execute when this composition completes successfully and is applying changes. |

### SideEffect

Cmn 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/Effects.kt+function:SideEffect) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.13.0-rc01)

```
@Composable
@NonRestartableComposable
fun SideEffect(key1: Any?, key2: Any?, key3: Any?, key4: Any?, effect: () -> Unit): Unit
```

Schedule `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` to run as a side effect for any new unique value of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` or `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`.

A `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`'s *keys* are values that defines the identity of the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`. When a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` recomposes, its `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will only execute if any of its keys differ from their previously provided value.

When using the overload of this function that doesn't accept keys, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will execute on every recomposition. This overload is preferred when you have one-shot work that doesn't require the coroutine afforded by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/LaunchedEffect.composable#LaunchedEffect(kotlin.coroutines.SuspendFunction1)`, or the disposal afforded by `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)`.

**Note:** For all overloads of `https://developer.android.com/reference/kotlin/androidx/compose/runtime/SideEffect.composable#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)`, the `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` is executed *after* all `https://developer.android.com/reference/kotlin/androidx/compose/runtime/DisposableEffect.composable#DisposableEffect(kotlin.Function1)` and `https://developer.android.com/reference/kotlin/androidx/compose/runtime/RememberObserver` callbacks are dispatched. Effects are executed in the order that they appear in the composition hierarchy (following an in-order traversal).

| Parameters |
|---|---|
| `key1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | A key input; if recomposed with a new value from the previous key, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will be scheduled. |
| `key2: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | A second key input; if recomposed with a new value from the previous key, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will be scheduled. |
| `key3: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | A third key input; if recomposed with a new value from the previous key, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will be scheduled. |
| `key4: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | A fourth key input; if recomposed with a new value from the previous key, `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#SideEffect(kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Any,kotlin.Function0)` will be scheduled. |
| `effect: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | The effect that will execute when this composition completes successfully and is applying changes. |