avoid multimodel update loop
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { onDestroy, onMount, untrack } from 'svelte';
|
||||
import { get } from 'svelte/store';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
@@ -239,8 +239,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
loading = fetchedData === null;
|
||||
refreshing = fetchedData !== null;
|
||||
const hasFetchedData = untrack(() => fetchedData !== null);
|
||||
loading = !hasFetchedData;
|
||||
refreshing = hasFetchedData;
|
||||
loadError = null;
|
||||
const timer = window.setTimeout(() => {
|
||||
const controller = new AbortController();
|
||||
|
||||
Reference in New Issue
Block a user