StateObject
-
Cmn
interface StateObject
NavBackStack |
A mutable back stack of |
SnapshotStateList |
An implementation of |
SnapshotStateMap |
An implementation of |
SnapshotStateSet |
An implementation of |
Interface implemented by all snapshot aware state objects. Used by this module to maintain the state records of a state object.
Summary
Public functions |
||
|---|---|---|
open StateRecord? |
mergeRecords(Produce a merged state based on the conflicting state changes. |
Cmn
|
Unit |
prependStateRecord(value: StateRecord)Add a new state record to the beginning of a list. |
Cmn
|
Public properties |
||
|---|---|---|
StateRecord |
The first state record in a linked list of state records. |
Cmn
|
Public functions
mergeRecords
open fun mergeRecords(
previous: StateRecord,
current: StateRecord,
applied: StateRecord
): StateRecord?
Produce a merged state based on the conflicting state changes.
This method must not modify any of the records received and should treat the state records as immutable, even the applied record.
| Parameters | |
|---|---|
previous: StateRecord |
the state record that was used to create the |
current: StateRecord |
the state record of the parent snapshot or global state. |
applied: StateRecord |
the state record that is being applied of the parent snapshot or global state. |
| Returns | |
|---|---|
StateRecord? |
the modified state or |
prependStateRecord
fun prependStateRecord(value: StateRecord): Unit
Add a new state record to the beginning of a list. After this call firstStateRecord should be value.
Public properties
firstStateRecord
val firstStateRecord: StateRecord
The first state record in a linked list of state records.