apply
Apply the changes made to state objects in this snapshot to the global state, or to the parent snapshot if this is a nested mutable snapshot.
Once this method returns all changes made to this snapshot are atomically visible as the global state of the state object or to the parent snapshot.
While a snapshot is active (after it is created but before apply or dispose is called) requires resources to track the values in the snapshot. Once a snapshot is no longer needed it should be either applied by calling apply or disposed by calling dispose. A snapshot that has been had is apply called can also have dispose called on it. However, calling apply after calling dispose will throw an exception.
Leaving a snapshot active could cause hard to diagnose memory leaks values are maintained by state objects for unneeded snapshots. Take care to always call dispose on any snapshot.