ObservationTarget


A target of snapshot read observation, passed to ComposeUiHost.observeReads.

Hosts that observe reads on behalf of a Compose hierarchy can use isObservationValid to discard observations whose target has been removed, for example with SnapshotStateObserver.clearIf { !(it as ObservationTarget).isObservationValid }.

Summary

Public properties

Boolean

true while the target is part of the hierarchy.

Cmn

Public properties

isObservationValid

val isObservationValid: Boolean

true while the target is part of the hierarchy. false once it has been removed, after which its observations are no longer needed and can be discarded.