take Nested Mutable Snapshot
open fun takeNestedMutableSnapshot(readObserver: SnapshotReadObserver? = null, writeObserver: SnapshotWriteObserver? = null): MutableSnapshot
Content copied to clipboard
Take a mutable snapshot of the state values in this snapshot. Entering this snapshot by calling enter allows state objects to be modified that are not visible to the this, the parent snapshot, until the apply is called.
Applying a nested snapshot, by calling apply, applies its change to, this, the parent snapshot. For a change to be visible globally, all the parent snapshots need to be applied until the root snapshot is applied to the global state.
All nested snapshots need to be disposed by calling dispose before resources associated with this snapshot can be collected. Nested active snapshots are still valid after the parent has been disposed but calling apply will fail.