LifecycleStartStopEffectScope



Receiver scope for LifecycleStartEffect that offers the onStopOrDispose clause to couple the ON_START effect. This should be the last statement in any call to LifecycleStartEffect.

This scope is also a LifecycleOwner to allow access to the (lifecycle)LifecycleStartStopEffectScope.lifecycle within the onStopOrDispose clause.

Summary

Public constructors

Cmn

Public functions

inline LifecycleStopOrDisposeEffectResult
onStopOrDispose(crossinline onStopOrDisposeEffect: LifecycleOwner.() -> Unit)

Provide the onStopOrDisposeEffect to the LifecycleStartEffect to run when the observer receives an (ON_STOP)Lifecycle.Event.ON_STOP event or must undergo cleanup.

Cmn

Public properties

open Lifecycle

The lifecycle being observed by this receiver scope

Cmn

Public constructors

LifecycleStartStopEffectScope

LifecycleStartStopEffectScope(lifecycle: Lifecycle)
Parameters
lifecycle: Lifecycle

The lifecycle being observed by this receiver scope

Public functions

onStopOrDispose

inline fun onStopOrDispose(crossinline onStopOrDisposeEffect: LifecycleOwner.() -> Unit): LifecycleStopOrDisposeEffectResult

Provide the onStopOrDisposeEffect to the LifecycleStartEffect to run when the observer receives an (ON_STOP)Lifecycle.Event.ON_STOP event or must undergo cleanup.

Public properties

lifecycle

open val lifecycleLifecycle

The lifecycle being observed by this receiver scope