Add debounce to API request

This commit is contained in:
Sol Fisher Romanoff 2022-06-22 19:42:27 +03:00
parent 9923ff587b
commit fb2fc686b1
Signed by: nbsp
GPG Key ID: 9D3F2B64F2341B62
1 changed files with 3 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
import RichContent from 'src/components/rich_content/rich_content.jsx'
import List from '../list/list.vue'
import withLoadMore from '../../hocs/with_load_more/with_load_more'
import { debounce } from 'lodash'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faCircleNotch
@ -151,9 +152,9 @@ const UserProfile = {
window.open(target.href, '_blank')
}
},
setNote () {
setNote: debounce(function () {
this.$store.dispatch('setNote', { id: this.userId, note: this.note })
}
}, 1500)
},
watch: {
'$route.params.id': function (newVal) {