RetainStateProvider.AlwaysKeepExitedValues


An implementation of RetainStateProvider that is not backed by a RetainScope and is always set to keep exited values. This object is stateless and can be used to orphan a nested RetainScope while maintaining it in a state where the scope keeps all exited values.

Summary

Public functions

open Unit

Registers the given observer with this RetainStateProvider to be notified when the value of isKeepingExitedValues changes.

Cmn
open Unit

Removes a previously registered observer.

Cmn

Public properties

open Boolean

Returns whether the associated retain scenario is active, and associated scopes should retain objects as they are removed from the composition hierarchy.

Cmn

Public functions

addRetainStateObserver

open fun addRetainStateObserver(
    observer: RetainStateProvider.RetainStateObserver
): Unit

Registers the given observer with this RetainStateProvider to be notified when the value of isKeepingExitedValues changes. The added observer will receive its first notification the next time isKeepingExitedValues is updated.

This method is not thread safe and should only be invoked on the applier thread.

removeRetainStateObserver

open fun removeRetainStateObserver(
    observer: RetainStateProvider.RetainStateObserver
): Unit

Removes a previously registered observer. It will receive no further updates from this RetainStateProvider unless it is registered again in the future. If the observer is not currently registered, this this method does nothing.

This method is not thread safe and should only be invoked on the applier thread.

Public properties

isKeepingExitedValues

open val isKeepingExitedValuesBoolean

Returns whether the associated retain scenario is active, and associated scopes should retain objects as they are removed from the composition hierarchy.