Equatable CasePath #26
Replies: 3 comments 5 replies
-
Unfortunately not. While it would be possible to add an Alternatively, you could wrap case paths in a type that is equatable by providing the strategy for comparing paths. Not ideal, but could unblock you. |
Beta Was this translation helpful? Give feedback.
-
I'm going to move this to be a discussion since it's not a bug, but is something that would be nice to solve (along with hashability), if anyone figures out how to do this! |
Beta Was this translation helpful? Give feedback.
-
Oh no!!! Could CasePath's lack of Equatable & Hashable conformance be why my tests aren't detecting any changes in TestStore's state? In the code below, let isOn = true
// item.action is of type CasePath<Reducer.Action, (UUID, Tagged<SwitchRowItem, UUID>, Bool)>
let action: UICollectionViewHelpersFeature.Action = item.action.embed((sectionId, itemId, isOn))
store.send(action) {
$0.updateSwitchRow(sectionId: sectionId, itemId: itemId, isOn: isOn) // complains that state didn't change
} |
Beta Was this translation helpful? Give feedback.
-
Is it possible to make CasePath Equatable?
Beta Was this translation helpful? Give feedback.
All reactions