hybridsjs / hybrids

Extraordinary JavaScript UI framework with unique declarative and functional architecture
https://hybrids.js.org
MIT License
3.05k stars 85 forks source link

Allow storing an object in a component property #257

Closed Qsppl closed 4 months ago

Qsppl commented 4 months ago

Due to the fact that it is forbidden to store objects in the property, I have to store the string identifier of the objects and retrieve the corresponding objects through a singleton when they are needed.

Or make default values ​​undefined and then assign real values ​​to undefined properties in the component initialization function.

image

image

This breaks the types and looks ugly. Is it possible to add the ability to write such code more declaratively?

smalluban commented 4 months ago

In v9 it will be possible to set the default value to any type when set by the full object descriptor. It's coming, but still, one missing feature is in "work in progress". I think it should be ready next week.

Qsppl commented 4 months ago

Thank you very much, I'll wait.

smalluban commented 4 months ago

v9.0.0 has been released, so it is possible now to set the property as an object instance. Feel free to re-open if you find any issues with that.

Qsppl commented 4 months ago

Thanks