with Mutable Snapshot
Take a MutableSnapshot and run block within it. When block returns successfully, attempt to MutableSnapshot.apply the snapshot. Returns the result of block or throws SnapshotApplyConflictException if snapshot changes attempted by block could not be applied.
Prior to returning, any changes made to snapshot state (e.g. state holders returned by androidx.compose.runtime.mutableStateOf are not visible to other threads. When withMutableSnapshot returns successfully those changes will be made visible to other threads and any snapshot observers (e.g. snapshotFlow) will be notified of changes.
block must not suspend if withMutableSnapshot is called from a suspend function.