MCPcopy Create free account
hub / github.com/SvelteStack/svelte-query / executeFetch

Method executeFetch

src/queryCore/core/queryObserver.ts:363–380  ·  view source on GitHub ↗
(
    fetchOptions?: ObserverFetchOptions
  )

Source from the content-addressed store, hash-verified

361 }
362
363 private executeFetch(
364 fetchOptions?: ObserverFetchOptions
365 ): Promise<TQueryData | undefined> {
366 // Make sure we reference the latest query as the current one might have been removed
367 this.updateQuery()
368
369 // Fetch
370 let promise: Promise<TQueryData | undefined> = this.currentQuery.fetch(
371 this.options as unknown as QueryOptions<TQueryFnData, TError, TQueryData, TQueryKey>,
372 fetchOptions
373 )
374
375 if (!fetchOptions?.throwOnError) {
376 promise = promise.catch(noop)
377 }
378
379 return promise
380 }
381
382 private updateStaleTimeout(): void {
383 this.clearStaleTimeout()

Callers 4

onSubscribeMethod · 0.95
setOptionsMethod · 0.95
fetchMethod · 0.95
updateRefetchIntervalMethod · 0.95

Calls 2

updateQueryMethod · 0.95
fetchMethod · 0.45

Tested by

no test coverage detected