forked from TanStack/query
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
9147e65
commit 3a6112c
Showing
7 changed files
with
39 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,31 @@ | ||
<script lang="ts"> | ||
import { createQuery, QueryClient } from '@tanstack/svelte-query'; | ||
import Simple from './paginate.svelte'; | ||
import Cache from './cacheUpdate.svelte'; | ||
import Simple1 from './test.svelte'; | ||
import DerivedQuery from './derivedQuery.svelte'; | ||
import Queries from './queries.svelte'; | ||
import CQueries from './CreateQueries.svelte'; | ||
import { useIsRestoring } from '@tanstack/svelte-query/dev'; | ||
const isRes = useIsRestoring(); | ||
let count = $state(-1); | ||
const options = $derived({ | ||
queryKey: () => [count, 'count'], | ||
queryFn: async () => { | ||
return count; | ||
}, | ||
enabled: () => count === 0 | ||
$effect(() => { | ||
console.log('is rest', isRes()); | ||
}); | ||
const query = createQuery(options); | ||
</script> | ||
|
||
<button onclick={() => (count += 1)}>Increment</button> | ||
<div>Data: {query.data ?? 'undefined'}</div> | ||
<div>Count: {count}</div> | ||
isReTORING:{isRes()} | ||
<!-- <h1>testing list query cache update</h1> | ||
<Simple /> | ||
<h1>testing DerivedQuery cache update</h1> --> | ||
<Simple1 /> | ||
<!-- <h1>testing pagination with createQuery</h1> | ||
<Simple /> | ||
<hr /> | ||
<h1>testing cache update</h1> | ||
<Cache /> | ||
<hr /> | ||
------------- | ||
<Simple1 /> | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters