forked from AkkomaGang/akkoma-fe
Add debounce to API request
This commit is contained in:
parent
9923ff587b
commit
fb2fc686b1
1 changed files with 3 additions and 2 deletions
|
@ -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 RichContent from 'src/components/rich_content/rich_content.jsx'
|
||||||
import List from '../list/list.vue'
|
import List from '../list/list.vue'
|
||||||
import withLoadMore from '../../hocs/with_load_more/with_load_more'
|
import withLoadMore from '../../hocs/with_load_more/with_load_more'
|
||||||
|
import { debounce } from 'lodash'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import {
|
import {
|
||||||
faCircleNotch
|
faCircleNotch
|
||||||
|
@ -151,9 +152,9 @@ const UserProfile = {
|
||||||
window.open(target.href, '_blank')
|
window.open(target.href, '_blank')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setNote () {
|
setNote: debounce(function () {
|
||||||
this.$store.dispatch('setNote', { id: this.userId, note: this.note })
|
this.$store.dispatch('setNote', { id: this.userId, note: this.note })
|
||||||
}
|
}, 1500)
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.params.id': function (newVal) {
|
'$route.params.id': function (newVal) {
|
||||||
|
|
Loading…
Reference in a new issue