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

Function options

packages/query-core/src/__tests__/queryObserver.test.tsx:2030–2037  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

2028 it('should keep a placeholder that select maps to undefined', async () => {
2029 const key = createKey()
2030 const options = (id: string) =>
2031 queryClient.defaultQueryOptions({
2032 queryKey: [...key, id],
2033 queryFn: () => [id],
2034 enabled: id !== '',
2035 placeholderData: keepPreviousData,
2036 select: (items: Array<string>) => items.find((item) => item === id),
2037 })
2038 const observer = new QueryObserver(queryClient, options('a'))
2039 const unsubscribe = observer.subscribe(() => undefined)
2040 await vi.advanceTimersByTimeAsync(0)

Callers 1

Calls 2

defaultQueryOptionsMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected