I am using vue-infinite-loading. I followed their documention. but don't understand. what are $state , $state->loaded(),$state->complete();
Below image is the error i am facing.
fetchReviews($state){
var vm = this;
axios.post('./fetch-reviews', {
u_id: vm.u_id,
params: {
page: this.page,
},
})
.then(({ data }) => {
if (data.reviews.length) {
this.page += 1;
this.list.push(...data.reviews);
$state.loaded();
} else {
$state.complete();
}
});
},