Skip to content
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

Provide a way to throttle/debounce reactive_read() invalidation #95

Open
cpsievert opened this issue Apr 4, 2023 · 1 comment
Open

Comments

@cpsievert
Copy link
Collaborator

Perhaps using the "recommended" ipywidgets implementations https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Events.html#throttling

@jcheng5
Copy link
Collaborator

jcheng5 commented Jun 21, 2023

Maybe not the most convenient, but I posted throttle and debounce decorators here: posit-dev/py-shiny#564

So instead of reactive_read(x, "foo") you could do:

@debounce(2)
@reactive.Calc
debounced_x_foo():
    return reactive_read(x, "foo")

and then refer to debounced_x_foo() everywhere you would've done reactive_read(x, "foo").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants