UBERF-5349 Fix incorrect store callback usage (#4554)

Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2024-02-07 01:35:53 +07:00 committed by GitHub
parent 04fa2ca777
commit 6357efda60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -1,9 +1,15 @@
<script lang="ts" context="module">
import { readable } from 'svelte/store'
const ticker = readable(Date.now(), (set) => {
setInterval(() => {
set(Date.now())
const interval = setInterval(() => {
set(Date.now())
}, 100)
return () => {
clearInterval(interval)
}
})
</script>

View File

@ -251,9 +251,15 @@ export function createApp (target: HTMLElement): SvelteComponent {
}
export const ticker = readable(Date.now(), (set) => {
setInterval(() => {
set(Date.now())
const interval = setInterval(() => {
set(Date.now())
}, 10000)
return () => {
clearInterval(interval)
}
})
addLocation(uiId, async () => ({ default: async () => ({}) }))