Atom
Atom is a unit of state in Space.
The instance created serves as a key to store values of a specified type in AtomStore. It is designed so that the instance itself acts as the reference key, instead of the user having to assign a unique key. Therefore, even if the definitions are exactly the same, different instances will be managed as separate keys.
Note: Specifying a saver is optional, but if you expect state restoration on the Android platform, it is crucial to specify it.
Usage:
val counterAtom = atom(0)
val titleAtom = atom("hello, world", saverKey = "title")
Content copied to clipboard
Parameters
T
The type of the value to be stored.