Replies: 1 comment 1 reply
-
@wltrup As a side note we did explore factoring the observable identity into equatability, but found that it made testing more difficult and went against the grain of how folks expect to equate values. |
Beta Was this translation helpful? Give feedback.
-
Hi Brandon and Stephen,
ever since your first video on adding identity to value types, I've been wondering about the potential impact of the added identifier on a state type's conformances to
Equatable
andHashable
. If I understand correctly, the only reason for the state type to beEquatable
is to support testing, in which case I assume you will handle internally any potential impact of the added identifier.However, what if someone needs the state to be
Equatable
and/orHashable
for their own reasons? Then two instances of the state - with the same data (other than their identifiers) - are not going to be equal despite the fact that, as far as the user of the Composable Architecture library is concerned, the two instances should be identical in that scenario.I don't have any specific example in mind but it is something that's puzzling me because it's a gotcha! waiting to happen and I'm wondering if you have thought about that problem.
As always, many thanks for the great work you're doing for the Apple developer ecosystem and for reading and answering people's questions.
Beta Was this translation helpful? Give feedback.
All reactions