8000 Dynamically set properties for `:query_tracked():set()` · Issue #42 · exerro/Sheets · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Dynamically set properties for :query_tracked():set() #42
Open
@exerro

Description

@exerro

In the following code:

app:query_tracked "?button[x >= 1] :set {
        colour = CYAN;
}

...any button whose x value is greater than 0 should have its colour set to cyan.

Restoration is another issue, however. Consider the following cases:

button1:set_colour "random()"
button2:set_colour "$$button1.colour"

If, to restore the value, it uses the computed value, button1 will have the same, correct colour, but button2 will lose its reference to button1, so if button1 changes its colour, button2 won't update like it should.
Otherwise, if to restore the value, it uses the raw dynamic value (e.g. "random()"), non-pure values will be re-evaluated and won't necessarily be the same.

I'd suggest that having references to other sheets is more important, so it would use the raw dynamic value and live with the occasional restoration mistake (it can be warned against and users can avoid using set() on tracked queries and just use themes (#)17 or something).

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0