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
Running this, and hitting compute triggers a keyerror in reacton. The fix is to put str(../) around the last line, but that should not be needed.
str(../)
import solara import time process = solara.reactive(0) def heavy_compute(): for i in range(10): print("Computing...", i) process.value = i time.sleep(0.1) return 42 @solara.component def Page(): compute = solara.use_reactive(False) result_using_reactive = solara.use_reactive(None) def maybe_do_compute(): if compute.value: result_using_reactive.value = heavy_compute() compute.set(False) result = solara.use_thread(maybe_do_compute, dependencies=[compute.value]) solara.Button("Compute", on_click=lambda: compute.set(True)) solara.Button("Cancel", on_click=lambda: compute.set(False)) if result.state == solara.ResultState.RUNNING: solara.ProgressLinear(process.value * 10) if result_using_reactive.value: solara.Text(result_using_reactive.value)
The text was updated successfully, but these errors were encountered:
Running this, and hitting compute triggers a keyerror in reacton. The fix is to put
str(../)
around the last line, but that should not be needed.The text was updated successfully, but these errors were encountered: