Skip to content

Thoughts on Hashable Actions #8

Answered by tgrapperon
JacksonUtsch asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!

From my experience, it's very difficult to have a root Action that can conform automatically to Hashable. As soon as some associated value isn't hashable, you need to implement hashable conformance for the whole type hosting the action. And you don't need to go far to encounter non-hashable types like CGSize or Animation. Of course, you can conform types you don't own to protocols you don't own, but this is generally considered a bad practice, and you see immediately how this can be tricky in some semi-opaque cases like Animation.

Aside from this, you will have as many identifiers as cases in your action. This usually works fine, especially for "naked" cases without associated valu…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JacksonUtsch
Comment options

Answer selected by JacksonUtsch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants