change chats to use custom makeFetcher
This commit is contained in:
parent
2d914c331e
commit
1b6eee0497
4 changed files with 10 additions and 11 deletions
|
@ -6,7 +6,6 @@ export const makeFetcher = (call, interval) => {
|
|||
|
||||
func = () => {
|
||||
call().finally(() => {
|
||||
console.log('callbacks')
|
||||
if (stopped) return
|
||||
timeout = window.setTimeout(func, interval)
|
||||
})
|
||||
|
@ -14,7 +13,7 @@ export const makeFetcher = (call, interval) => {
|
|||
|
||||
const stopFetcher = () => {
|
||||
stopped = true
|
||||
window.cancelTimeout(timeout)
|
||||
window.clearTimeout(timeout)
|
||||
}
|
||||
|
||||
func()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import apiService from '../api/api.service.js'
|
||||
import makeFetcher from '../fetcher/fetcher.js'
|
||||
import { makeFetcher } from '../fetcher/fetcher.js'
|
||||
|
||||
const update = ({ store, notifications, older }) => {
|
||||
store.dispatch('setNotificationsError', { value: false })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue