如何在async
函数中使用debounce
?在我的vue
应用程序中,我有一个方法,可以从一个API中获取数据,该API会连续调用我想要避免的API.
以下是我的方法:
methods: {
async getAlbums () {
const response = await AlbumService.fetchAlbums()
this.albums = response.data.albums
}
}
我之前已经安装了lodash
个,那么我该如何实现呢?