Views and actions on a union #2081
Replies: 1 comment
-
Hey @davetapley - would the compose type fit your use case for defining views and actions on the union of some models? I know it's not exactly what you're looking for, but depending on how you want to use it, maybe that's helpful? As for a better way to switch, nothing really comes to mind. If you read some of the source where we set up model definitions and handle different primitive and complex types, you'll there's a lot of Sorry I can't be more helpful. If you have a proposal for a new type of union, I'd be happy to talk it out. It's not a high priority on the maintainers' end, but there's nothing quite like a well tested and well documented PR to sail through the approval process, especially if you can bolt it on without breaking anything haha. Sorry for the late response! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be cool if I could define
.views
and.actions
on aunion
.Currently I have to:
I'd love to just be able to
foo.stuff()
and:I assume this would require either a breaking change, or a new type of union altogether, which isn't necessarily a bad thing because there's also #1907 (comment) and:
Also, is there a more elegant way to
switch
on the concrete type instead of usingif
andis
?Beta Was this translation helpful? Give feedback.
All reactions