OnDispose

fun OnDispose(callback: () -> Unit)

Executes callback when the current composition leaves the composition.

This is a convenience wrapper around DisposableEffect(Unit) that ensures the latest provided callback is invoked during disposal.