If using the resource args as a property of component args works for your scenario, I think that’s a good option
g
gray-ambulance-59402
07/21/2020, 7:56 AM
Thanks @tall-librarian-49374- That would work for most scenarios. I guess the only downside of doing it this way (Correct me if i'm wrong?) is that if I want to override a value to be set as default, it cannot be hidden from the args so a consumer of the component might set it as one value but it will then get overriden. (Thinking of a security option that I would like to enforce on the resource)
t
tall-librarian-49374
07/21/2020, 7:58 AM
Yes, indeed. You could prohibit those scenarios by runtime checks in constructors, but not at compile time.
tall-librarian-49374
07/21/2020, 7:58 AM
TypeScript is actually quite powerful for such scenarios, where you can define types based on the shapes of other types and mix them together nicely. .NET is quite a bit more rigid, so you’d either have to duplicate, or allow inconsistencies mitigated at runtime.