You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common use-case of debouncing operations is to reduce the number of search requests emitted by a front-end application to an API. Example: Only send a search request with the input text as a query when the user does not type for 200ms.
Given that currently use_debounce cannot take in an async fn as a parameter, users have to spawn a task to fetch the desired data.
I believe that it could make sense to support this case, to more ergonomically support users' use-cases which often require async to e.g. make API requests. This could potentially also enable cancelling futures that have not yet resolved when the callback should fire once more, dismissing stale data.
The text was updated successfully, but these errors were encountered:
A common use-case of debouncing operations is to reduce the number of search requests emitted by a front-end application to an API. Example: Only send a search request with the input text as a query when the user does not type for 200ms.
Given that currently
use_debounce
cannot take in anasync fn
as a parameter, users have tospawn
a task to fetch the desired data.I believe that it could make sense to support this case, to more ergonomically support users' use-cases which often require async to e.g. make API requests. This could potentially also enable cancelling futures that have not yet resolved when the callback should fire once more, dismissing stale data.
The text was updated successfully, but these errors were encountered: