-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: computed reactive variables #455
Merged
maartenbreddels
merged 2 commits into
master
from
01-10-feat_Computed_reactive_variables_and_Singleton
Feb 9, 2024
Merged
feat: computed reactive variables #455
maartenbreddels
merged 2 commits into
master
from
01-10-feat_Computed_reactive_variables_and_Singleton
Feb 9, 2024
Conversation
This file contains 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
This was referenced Jan 10, 2024
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @maartenbreddels and the rest of your teammates on Graphite |
maartenbreddels
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
from
January 12, 2024 11:13
eca69f7
to
530c72b
Compare
maartenbreddels
force-pushed
the
01-10-refactor_make_a_base_class_for_reactive_auto_subscribe_context_manager
branch
from
January 12, 2024 13:02
58fe1a8
to
1e3ab7e
Compare
maartenbreddels
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
2 times, most recently
from
January 18, 2024 09:33
2a2db1c
to
f4e000c
Compare
maartenbreddels
changed the base branch from
01-10-refactor_make_a_base_class_for_reactive_auto_subscribe_context_manager
to
master
January 18, 2024 09:33
maartenbreddels
changed the base branch from
master
to
01-18-feat_on_kernel_start_triggers_callback_on_virtual_kernel_start
January 19, 2024 10:47
maartenbreddels
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
from
January 19, 2024 10:47
f4e000c
to
fd38bdc
Compare
maartenbreddels
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
from
January 19, 2024 12:58
fd38bdc
to
d729d5d
Compare
This was referenced Jan 19, 2024
maartenbreddels
force-pushed
the
01-18-feat_on_kernel_start_triggers_callback_on_virtual_kernel_start
branch
from
January 19, 2024 19:37
6e163fd
to
0933395
Compare
maartenbreddels
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
2 times, most recently
from
January 19, 2024 20:36
96720b1
to
fd6ce25
Compare
maartenbreddels
changed the title
feat: Computed reactive variables and Singleton.
feat: computed reactive variables
Jan 19, 2024
maartenbreddels
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
2 times, most recently
from
January 22, 2024 11:48
3e25f02
to
c2c3c95
Compare
iisakkirotko
force-pushed
the
01-18-feat_on_kernel_start_triggers_callback_on_virtual_kernel_start
branch
from
February 5, 2024 13:36
0933395
to
a99f167
Compare
iisakkirotko
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
from
February 5, 2024 13:36
c2c3c95
to
0134661
Compare
This was referenced Feb 5, 2024
iisakkirotko
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
from
February 5, 2024 14:56
0134661
to
a2b582f
Compare
iisakkirotko
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
from
February 8, 2024 16:04
a2b582f
to
6acaeba
Compare
iisakkirotko
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
from
February 8, 2024 16:14
6acaeba
to
5b55459
Compare
iisakkirotko
changed the base branch from
01-18-feat_on_kernel_start_triggers_callback_on_virtual_kernel_start
to
master
February 8, 2024 16:14
maartenbreddels
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
2 times, most recently
from
February 9, 2024 15:22
bbb7584
to
7bd5707
Compare
* feat: get_kernel_id and get_session_id for custom storage If you want to store data in a custom storage, you need to know the kernel_id or session_id to scope. This can be used to implement something similar to reactive variables.
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.
maartenbreddels
force-pushed
the
01-10-feat_Computed_reactive_variables_and_Singleton
branch
from
February 9, 2024 16:10
7bd5707
to
7d63ad0
Compare
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.
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:
z.value will be lazily executed the first time, and will be updated
when one of the dependencies changes.