I need to change this as I have read nextTick is a better option compared to deferred.
This is the original code that works well:
methods: {
...mapActions(['fetchOverdraftLogs', 'setOverdraftFilters', 'fetchUserEventsCsvFile']),
},
computed: {
...mapGetters(['getOverdraftLogs'])
},
...
loadData: filters => {
const d = $.Deferred()
this.fetchOverdraftLogs({ params: this.filtersToSend(filters) })
.then(res => {
d.resolve(this.getOverdraftLogs)
this.setFilterValues()
})
return d.promise()
})
}
However, I am not able to rework this with nextTick:
loadData: filters => {
this.fetchOverdraftLogs({ params: this.filtersToSend(filters) })
this.$nextTick(() => {
this.setFilterValues()
this.getOverdraftLogs
})
}
I need to make sure for the grid that after the API is called it reads the data from the state.
Could you assist?