I am trying to import the debounce
function in my VueJs project.
I ran: npm i --save lodash.debounce
Then I imported it in my project with: import { debounce } from 'lodash/debounce'
And tried using it with:
debounce(() => {
console.log('I only get fired once every two seconds, max!')
}, 2000)
I also tried importing it as import debounce from 'lodash/debounce'
, but whatever I do I cannot get it to work.
I read this stack post but that also doesn't seem to work: How to Import a Single Lodash Function?
Anyone knows how to do this?
Thanks.