refactor: make theme variant_user_selectable default to OS theme if not previously set#495
Closed
iisakkirotko wants to merge 15 commits into02-05-feat_support_theming_solarafrom
Conversation
This was referenced Feb 5, 2024
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @iisakkirotko and the rest of your teammates on |
0599961 to
f8b0e84
Compare
44a4a16 to
b76c207
Compare
f8b0e84 to
5a324e6
Compare
b76c207 to
69e5295
Compare
5a324e6 to
c71d5c3
Compare
69e5295 to
562911d
Compare
b4d6684 to
10fe4e7
Compare
Creates a reactive variable that is set to the return value of the function.
The value will be updated when any of the reactive variables used in the function
change.
Example:
```solara
import solara
import solara.lab
a = solara.reactive(1)
b = solara.reactive(2)
@solara.lab.computed
def total():
return a.value + b.value
def reset():
a.value = 1
b.value = 2
@solara.component
def Page():
print(a, b, total)
solara.IntSlider("a", value=a)
solara.IntSlider("b", value=b)
solara.Text(f"a + b = {total.value}")
solara.Button("reset", on_click=reset)
```
z.value will be lazily executed the first time, and will be updated
when one of the dependencies changes.
Creates a reactive variable that is set to the return value of the function.
The value will be updated when any of the reactive variables used in the function
change.
Example:
```solara
import solara
import solara.lab
a = solara.reactive(1)
b = solara.reactive(2)
@solara.lab.computed
def total():
return a.value + b.value
def reset():
a.value = 1
b.value = 2
@solara.component
def Page():
print(a, b, total)
solara.IntSlider("a", value=a)
solara.IntSlider("b", value=b)
solara.Text(f"a + b = {total.value}")
solara.Button("reset", on_click=reset)
```
z.value will be lazily executed the first time, and will be updated
when one of the dependencies changes.
Both are very similar, but Singleton will never re-compute,
both are not settable (read-only).
Example:
```python
from solara.toestand import Computed, Reactive
x = Reactive(1)
y = Reactive(2)
def conditional_add():
if x.value == 0:
return 42
else:
return x.value + y.value
z = Computed(conditional_add)
```
z.value will be lazily executed the first time, and will be updated
when one of the dependencies changes.
use_task can replace use_thread, but also support coroutine functions. task is a decorator that creates a top level task that can be executed from any location (e.g. a click handler of a button).
Co-authored-by: Iisakki Rotko <[email protected]>
Co-authored-by: Iisakki Rotko <[email protected]>
Co-authored-by: Iisakki Rotko <[email protected]>
… not previously set
10fe4e7 to
f58e32e
Compare
562911d to
ed0ec10
Compare
f58e32e to
d03f038
Compare
c41779e to
162cf58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.