Open DNAScanner opened 1 year ago
Sorry for delayed response, I was on vacations.
Properties of rectangle
cannot be set as Signal
/Computed
but rectangle
itself can be.
You can do
const rectangle = { column: 0, row: 0, width: 0, height: 0 };
const box = new Box({
...,
rectangle: new Computed(() => {
rectangle.column = x.value;
rectangle.row = y.value;
return rectangle;
}),
});
I have plans for improving working with objects using signals, because I can see how this can become annoying/tedious.
This works, thank you. Wouldnt it be nice though, if there was native support for Computed values for rectangle.column directly instead of that workaround?
When I will have more time I plan to add support for easier usage of Signal
/Computed
on objects, I agree that's definitely something that can be improved.
If you feel like this is enough for now, feel free to close this issue, otherwise you can leave it open until it gets improved from the deno_tui
.
Bug description Cant set Box rectangle.column / rectangle.row via Computed
Expected behavior Auto update the Box' position using Signal and Computed
Reproduction Code to reproduce the behavior:
Information (please complete) It seems, that the rectangle.column and rectangle.row, dont currently support Computed properties as their values.