Use this function if you want to "mutate" the current state by copying the old state and modify some properties in the copy of the new state. A common use case is to call .copy() on your state defined as data class.

snapshot should never be accessed within reducer. Use the this of the lambda which is guaranteed to be the current state at the time of execution instead.