Force debounce to fire before component unmounts/destroyed #68
Replies: 3 comments 2 replies
-
There isn't a way to fire it off right away directly, since usually you want to run this with a input of some kind so usually if you leave that input for another page, the call should cancel out instead of finishing (could cause weirdness in navigation). I might need a clearer picture of what's happening in this instance. |
Beta Was this translation helpful? Give feedback.
-
@dhershman1 - Any further thoughts on this? |
Beta Was this translation helpful? Give feedback.
-
In this type of situation @TerryCaliendo-WealthCounsel would it be a better idea to check if your value is populated and call the function directly you need to call in the unmount hook? If not my approach to this might be adding an option, and if possible I'd like to see if I can listen for the hook itself in the plugin. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to force the debouncer to fire from the "beforeDestroy" on the component? I'm having issues where if the user changes a field and then quickly clicks on something that causes the UI to change (and therefore the component to get destroyed) before the debounce duration completes, the final debounce doesn't fire.
Beta Was this translation helpful? Give feedback.
All reactions