enter
Enter the snapshot. In block all state objects have the value associated with this snapshot. The value of currentSnapshot will be this snapshot until this block returns or a nested call to enter is called. When block returns, the previous current snapshot is restored if there was one.
All changes to state object inside block are isolated to this snapshot and are not visible to other snapshot or as global state. If this is a readonly snapshot, any changes to state objects will throw an IllegalStateException.
For a MutableSnapshot, changes made to a snapshot inside block can be applied atomically to the global state (or to its parent snapshot if it is a nested snapshot) by calling MutableSnapshot.apply.