This would ideally create a counter that has a starting value of 5, but otherwise would work like a normal counter.
At the moment, while the counter does show 5, it also stops working.
I'm pretty sure this is because cls.count is actually an rx.Var, and it is being replaced with just an integer. So then the layout is being created with a fixed integer rather than the Var instance.
I think the solution to this will also relate to #3711 << Which is also something I would like to be able to do.
I'd like to be able to create re-usable components, but providing some initial default values when I create them.
For example:
This would ideally create a counter that has a starting value of 5, but otherwise would work like a normal counter.
At the moment, while the counter does show 5, it also stops working.
I'm pretty sure this is because cls.count is actually an rx.Var, and it is being replaced with just an integer. So then the layout is being created with a fixed integer rather than the Var instance.
I think the solution to this will also relate to #3711 << Which is also something I would like to be able to do.
As a sort of workaround, you can instead do:
Which then does have the desired behaviour.
But, that's a lot of work to achieve something relatively simple.
Is there a different way of looking at this?