Snapshot Notifier
The different snapshot notification modes of Molecule.
Compose uses snapshots to provide a consistent view of state. Mutations to state outside of the composition are not automatically observed, and notifications of changes must be manually sent. This can be achieved by registering a global write observer, for which you need at-minimum one per process. Applications which use other Compose-based systems like Compose UI likely already have one in place, whereas applications that only use Molecule need its automatic registering of this notifier.
On the JVM and Android, Molecule will read the app.cash.molecule.snapshotNotifier
system property in order to determine the default mechanism. The value is parsed with enumValueOf, or else defaults to WhileActive if not set or the property does not parse to a value.
See also
Entries
Properties
Functions
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Returns an array containing the constants of this enum type, in the order they're declared.