Answer the question
In order to leave comments, you need to log in
Is there any easy replacement for lodash.debounce?
Hello, tell me please, I have such a component:
<template>
<div class="search">
<input name="search" type="text" class="search__input" v-on:input="fnSendSearch">
</div>
</template>
<script>
import lodash from 'lodash';
export default {
model: {
prop: 'query',
event: 'query-search',
},
data: function() {
return {
query: null,
fnSendSearch: Function,
}
},
created: function() {
this.fnSendSearch = lodash.debounce(this.sendSearch,300);
},
methods: {
sendSearch: function(event) {
this.$emit('query-search',event.target.value);
}
},
}
</script>
lodash
just for one thing.lodash.debounce(this.sendSearch,300);
Please tell me if there is any alternative not to pull up the whole library. Thank you in advance
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question