Skip to content

Copyable snapshots#16

Merged
stephencelis merged 7 commits into
mainfrom
copies
Jun 15, 2026
Merged

Copyable snapshots#16
stephencelis merged 7 commits into
mainfrom
copies

Conversation

@stephencelis

Copy link
Copy Markdown
Member

While snapshots are simple data types, they are not necessarily value types, and so mutating a reference snapshot effectively mutates all references to that snapshot.

This is not a problem with the built-in tools like expect, but for integrations that hold onto snapshots over time (like ComposableArchitecture 2.0's TestStore), explicit copying is needed at times.

While snapshots are simple data types, they are not necessarily _value_
types, and so mutating a reference snapshot effectively mutates _all_
references to that snapshot.

This is not a problem with the built-in tools, like `expect`, but for
integrations that hold onto snapshots over time (like
ComposableArchitecture 2.0), explicit copying is needed at times.
@stephencelis stephencelis requested a review from mbrandonw May 28, 2026 21:25
@stephencelis stephencelis merged commit 0b74a3d into main Jun 15, 2026
4 checks passed
@stephencelis stephencelis deleted the copies branch June 15, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants