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

Function Test

packages/solid-query/src/__tests__/useQuery.test-d.tsx:284–296  ·  view source on GitHub ↗
(props: {
        dataType: TDataType
      })

Source from the content-addressed store, hash-verified

282 ) => 'test'
283
284 function Test<TDataType extends DataType>(props: {
285 dataType: TDataType
286 }) {
287 const { data } = useQuery(() => ({
288 queryKey: ['test'],
289 queryFn: () => getData(props.dataType),
290 }))
291
292 // Regression guard: this call must compile. With the previous
293 // hand-rolled NoInfer, `data` failed to flow back into the generic
294 // indexed-access parameter `DataTypeToEntity[TDataType]`.
295 return data ? getLabel(props.dataType, data) : null
296 }
297
298 expectTypeOf(Test).toBeFunction()
299 })

Callers

nothing calls this directly

Calls 3

getDataFunction · 0.70
getLabelFunction · 0.70
useQueryFunction · 0.50

Tested by

no test coverage detected