Skip to content

Commit

Permalink
untrack
Browse files Browse the repository at this point in the history
  • Loading branch information
zhihengGet committed Jul 17, 2024
1 parent f160633 commit 4c8c080
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/svelte-query/src/createQueries.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {
QueryObserverResult,
ThrowOnError,
} from '@tanstack/query-core'
import { untrack } from 'svelte'

// This defines the `CreateQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.
// `placeholderData` function does not have a parameter
Expand Down Expand Up @@ -252,7 +253,10 @@ export function createQueries<
if (isRestoring()) {
return () => null
}
Object.assign(result, getCombinedResult(trackResult()))
untrack(() => {
Object.assign(result, getCombinedResult(trackResult()))
})

return observer.subscribe((result_) => {
console.log(result_)
notifyManager.batchCalls(() => {
Expand Down

0 comments on commit 4c8c080

Please sign in to comment.