Closed Qsppl closed 5 months ago
Perhaps, instead of a universal function setProperty
, we should use special setModelId
for the case when a property with a model descriptor is assigned ModelIdentifier
and clearModel
for the case when the same property needs to be assigned the value undefined
.
As this might work, I am not a fan of adding a function to just make an assertion because an optional language has some limitations in definitions. I am waiting for a nicer solution on the TS side.
Okay, I'll write them such a proposal on GitHub with examples from other typed languages where there is no such restriction. I'll let you know what they say.
Originally posted by @smalluban in https://github.com/hybridsjs/hybrids/issues/237#issuecomment-2009503303
I wrote a helper function to assign values to component properties without typing errors:
Could you embed it somewhere in the library?