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
I came across this in a shared component. vue-debounce-decorator no longer worked with Vue 2.7.
Old:
import { Debounce } from 'vue-debounce-decorator'
/**
* Called when prop changes (ie, v-model is updated by parent).
* This method is debounced to prevent excessive validation.
*/
@Watch('value')
@Debounce(300)
private onValueChanged (val: string): void {
this.emitValid(val)
}
New:
import { debounce } from 'lodash'
/**
* Called when prop changes (ie, v-model is updated by parent).
* This method is debounced to prevent excessive validation.
*/
@Watch('value')
private onValueChanged (val) {
this.onValueChangedDebounced(val)
}
private onValueChangedDebounced = debounce((val: string) => {
this.emitValid(val)
}, 300)
Since we have a working solution, I'm closing this ticket.
Activity
lambert-alex commentedon Oct 7, 2022
Vue 3 implementation in search-ui
severinbeauvais commentedon Jul 11, 2023
I came across this in a shared component.
vue-debounce-decoratorno longer worked with Vue 2.7.Old:
New:
Since we have a working solution, I'm closing this ticket.
severinbeauvais commentedon Jul 20, 2023
See also https://vueuse.org/useDebounceFn