Debounce Function

Add a function with debouncedValidation on that function call another, the meaning of this is it will wait for 1000ms then execute the inside function

        debouncedValidation: _.debounce(function (e) {
            this.updateNameValidation(e);
        }, 1000),
       updateNameValidation: function updateNameValidation(e) {
            const currentname = this.model.attributes.name
            const self = this;
            .

            ....
        },

Leave a comment

Your email address will not be published. Required fields are marked *