Is there a way to set isLoading = true
prior to the function being executed? Currently, isLoading
remains false until the debounced function is triggered.
<script>
import _ from 'lodash'
export default {
data: {
isLoading: false;
}
methods: {
fetch: _.debounce(function() {
this.isLoading = true;
// perform data fetching
this.isLoading = false;
}, 200)
}
}
</script>