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

Method updateOptions

src/queryCore/core/queryObserver.ts:209–226  ·  view source on GitHub ↗
(
    options?: Partial<QueryObserverOptions<
      TQueryFnData,
      TError,
      TData,
      TQueryData,
      TQueryKey
    >>,
    notifyOptions?: NotifyOptions
  )

Source from the content-addressed store, hash-verified

207 }
208
209 updateOptions(
210 options?: Partial<QueryObserverOptions<
211 TQueryFnData,
212 TError,
213 TData,
214 TQueryData,
215 TQueryKey
216 >>,
217 notifyOptions?: NotifyOptions
218 ): void {
219 const mergedOptions = { ...this.options, ...options }
220
221 if (options.queryKey && !options.queryHash && options.queryKey !== this.options.queryKey) {
222 mergedOptions.queryHash = hashQueryKeyByOptions(options.queryKey, mergedOptions)
223 }
224
225 this.setOptions(mergedOptions, notifyOptions)
226 }
227
228 getOptimisticResult(
229 options: QueryObserverOptions<

Callers

nothing calls this directly

Calls 2

setOptionsMethod · 0.95
hashQueryKeyByOptionsFunction · 0.90

Tested by

no test coverage detected