-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reactive_task decorator (re)runs a task when a dependency changes
Dependencies are other reactive variables. Examples: ``` import asyncio import time import solara from solara.lab import reactive_task x = solara.reactive(2) @reactive_task async def x_square(): await asyncio.sleep(2) a = b return x.value**2 @solara.component def Page(): solara.SliderInt("x", value=x, min=0, max=10) if x_square.value.state == solara.ResultState.FINISHED: solara.Text(repr(x_square.value.value)) solara.ProgressLinear(x_square.value.state == solara.ResultState.RUNNING) ```
- Loading branch information
1 parent
6e376a3
commit 3760636
Showing
4 changed files
with
141 additions
and
3 deletions.
There are no files selected for viewing
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 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 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 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