How do I cancel a debounced handler before it runs? #13
-
|
I am wiring a debounced input handler and need to cancel it when a component unmounts. Which method should I call? |
Beta Was this translation helpful? Give feedback.
Answered by
shnwazdeveloper
May 10, 2026
Replies: 1 comment
-
|
Call |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
clyxudev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Call
debounced.cancel(). It clears the pending timer and forgets the stored arguments/context, so the original function will not run later. You can checkdebounced.pending()before canceling if you need to know whether a delayed call existed.