atom
Creates an Atom using AtomSaverKey for Parcelable.
Return
The created Atom.
Parameters
The type of the value to be stored.
The initial value to be stored.
The key to be used to save and restore the value.
The scope to be used to manage the value.
Creates an Atom using AtomSaverKey for ArrayList with Parcelable.
Return
The created Atom.
Parameters
The type of the value to be stored.
The initial value to be stored.
The key to be used to save and restore the value.
The scope to be used to manage the value.
Creates an Atom using AtomSaverKey for Array with Parcelable.
Return
The created Atom.
Parameters
The type of the value to be stored.
The initial value to be stored.
The key to be used to save and restore the value.
The scope to be used to manage the value.
Creates an Atom using AtomSaverKey for Serializable.
Return
The created Atom.
Parameters
The type of the value to be stored.
The initial value to be stored.
The key to be used to save and restore the value.
The scope to be used to manage the value.
Creates an Atom.
Return
The created Atom.
Parameters
The type of the value to be stored.
The initial value to be stored.
The saver to be used to save and restore the value.
The scope to be used to manage the value.
Creates an Atom using AtomSaverKey.
Automatically selects an AtomSaver for the Type if it matches any of the following. The saverKey is used as a key for the AtomSaver.
| Type | AtomSaver |
| :---------- | :-------------|
| String | stringSaver |
| Boolean | booleanSaver |
| Int | intSaver |
| Long | longSaver |
| Double | doubleSaver |
| Float | floatSaver |
| Char | charSaver |
| Short | shortSaver |
| Byte | byteSaver |
Return
The created Atom.
Parameters
The type of the value to be stored.
The initial value to be stored.
The key to be used to save and restore the value.
The scope to be used to manage the value.
Creates an Atom using AtomSaverKey for ArrayList.
Automatically selects an AtomSaver for the Type if it matches any of the following. The saverKey is used as a key for the AtomSaver.
| Type | AtomSaver |
| :-------------- | :---------------------------- |
| String | stringArrayListSaver |
| Int | integerArrayListSaver |
| CharSequence | charSequenceArrayListSaver |
Return
The created Atom.
Parameters
The type of the value to be stored.
The initial value to be stored.
The key to be used to save and restore the value.
The scope to be used to manage the value.
Creates an AtomRef with the specified block function.
Usage:
val counter1Atom = atom(0)
val counter2Atom = atom(0)
val sumAtom = atom {
get(counter1Atom) + get(counter2Atom)
}
Return
The created AtomRef.
Parameters
The type of the value to be retrieved.
The function that retrieves the value derived from one or more Atom references key.