[Vuejs]-Lodash's debounce and vue3

1👍

this will never work the way u want it to.

it’s like sifriday said, debounce returns a (new) function and you would need to re-call that function for a correct working debounce. but in your store you have an anonymous function, so there’s no reference to actually debounce it.

you could add a loading state & then do a debounce on a commit which toggles this state OR wrap the action itself in a debounce.

👤zangab

Leave a comment