-
Notifications
You must be signed in to change notification settings - Fork 84
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: Add reactive.delay
#1814
Comments
Could you explain a bit more about why you'd want to delay the reactive evaluation? |
My current use case is "on modal close, wait 1 second, update chatlas user input". After submitting the modal close, many other reactives could be run within the 1 second wait. If the UI isn't being constructed, then the wait is unnecessary and timing is bad. |
For my particular use case, it could be resolved with Since |
Yeah, I've learned to be very suspicious of any kind of magical delays, to me it almost always indicates a missing step in the reactive graph or a missing event client-side. |
Goal: I'd like to have a reactive event or calculation run after a set amount of time. I'd like for the reactive graph to not be blocked while waiting.
Related to
debounce
/throttle
issue: #564 . It could be argued that a single use ofdelay
isthrottle
andthrottle
would de a better job at cancelling previous jobs to deter concurrent delays at the same time.While
debounce
andthrottle
both have cancellation policies,delay
could be a third option where there is no cancellation policy... only a delay between the trigger and execution.(Either way, this is more motivation for any of these methods to be added!)
Naive implementation:
Extended task impl:
Goal API
The text was updated successfully, but these errors were encountered: