Debouncing a Vue Component method with Lodash Debouncing a Vue Component method with Lodash vue.js vue.js

Debouncing a Vue Component method with Lodash


Change dTest to:

dTest = _.debounce(() => {    console.log('hi');}, 2000);

With your dTest, you are creating a new debounce function every time dTest is run. You are meant to create this function only once, like you see above, then call that function every time.