Skip to content

function onLifecycleDestroying view code

onLifecycleDestroying(
    listener: (destroyedLifecycle: Lifecycle<Args...>) -> ()
): () -> ()

Called just before a lifecycle is destroyed. The listener callback receives the lifecycle that is destroyed.

Listener callbacks are expected to be non-yielding and infallible.

Parameters

listener: (destroyedLifecycle: Lifecycle) -> ()

Fired just before any lifecycle is being destroyed. The listener callbacj receives the lifecycle that is being destroyed.

Returns

() -> ()

A callback that when called removes the listener.