Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(UnionConverter): Support upconvert from string to nullary case #116

Open
bartelink opened this issue Feb 23, 2024 · 0 comments
Open

Comments

@bartelink
Copy link
Collaborator

bartelink commented Feb 23, 2024

Support upconversion from a representation of an event starts with TypeSafeEnumConverter for a given union (and hence has a string value), being able to implicitly upconvert from that if the internal representation adds a non-nullary case (and hence switches to using UnionConverter).

Of course, in general one should have a clear picture of whether something is an enum or a full state with data per case. The point here is to be able to represent data that's specific to a case without that having to stuff it into adjacent optional fields with conditional logic defining when the field should be present etc.

#97 is slightly related, but is going the other direction, and is recovering from a missing converter rather than a natural evolution

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

No branches or pull requests

1 participant