MCPcopy Create free account
hub / github.com/TanStack/query / constructor

Method constructor

packages/query-core/src/queryObserver.ts:86–103  ·  view source on GitHub ↗
(
    client: QueryClient,
    public options: QueryObserverOptions<
      TQueryFnData,
      TError,
      TData,
      TQueryData,
      TQueryKey
    >,
  )

Source from the content-addressed store, hash-verified

84 #trackedProps = new Set<keyof QueryObserverResult>()
85
86 constructor(
87 client: QueryClient,
88 public options: QueryObserverOptions<
89 TQueryFnData,
90 TError,
91 TData,
92 TQueryData,
93 TQueryKey
94 >,
95 ) {
96 super()
97
98 this.#client = client
99 this.#selectError = null
100
101 this.bindMethods()
102 this.setOptions(options)
103 }
104
105 /**
106 * Binds the methods of the result (`refetch`) to the observer, so they keep working when destructured

Callers

nothing calls this directly

Calls 2

bindMethodsMethod · 0.95
setOptionsMethod · 0.95

Tested by

no test coverage detected