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

add async variant for useThrottleFn and useDebounceFn #1697

Closed
4 tasks done
userquin opened this issue Jun 17, 2022 · 2 comments
Closed
4 tasks done

add async variant for useThrottleFn and useDebounceFn #1697

userquin opened this issue Jun 17, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@userquin
Copy link
Contributor

userquin commented Jun 17, 2022

Clear and concise description of the problem

When using useThrottleFn or useDebounceFn with an async callback, if the callback throws an error, the error is not handled by the global error handler nor errorCaptured component instance (if configured).

Suggested solution

Add an async variant and check for the global error handler or errorCaptured.

Beware, check the Error Propagation Rules on errorCaptured.

Vue 2 and Vue 3 seems to be in sync.

Alternative

capture the error inside the callback, but them, we need to handle the error on each usage instead globally, a lot of work.

Additional context

No response

Validations

@userquin userquin added the enhancement New feature or request label Jun 17, 2022
@userquin userquin mentioned this issue Jul 6, 2022
8 tasks
@userquin
Copy link
Contributor Author

userquin commented Jul 6, 2022

A common use case is about multiple form submissions when the user clicks multiple times on the submit button: all my forms have the form @submit.prevent using useThrottleFn (the submit button has the submit type).

About useDebounceFn a common use case: seach input text to remote api.

@stale
Copy link

stale bot commented Sep 14, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 14, 2022
@stale stale bot closed this as completed Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant