'lodash debounce not triggering
I am using lodash debounce inside several forms, which are rendered in Vue's v-for. My problem is the debounce has to be applied to all of them separatedly, but currently I am calling the method on every form created and that function is debounced across all the form components. Only the latest created one does the request.
The function is:
import debounce from 'lodash/debounce';
const debouncedValidateForm = debounce((vm) => {
vm.$nextTick(() => vm.validateForm({ form: vm.form.uuid, data: vm.answers }));
}, 1000);
It gets called in a watcher when each form loads its instance data. All the form components do, but as explained before all the components interfere with each other's debounce.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
