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

Function Test

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

Source from the content-addressed store, hash-verified

291 ) => 'test'
292
293 function Test<TDataType extends DataType>(props: {
294 dataType: TDataType
295 }) {
296 const { data } = useQuery(() => ({
297 queryKey: ['test'],
298 queryFn: () => getData(props.dataType),
299 }))
300
301 // Regression guard: this call must compile. With the previous
302 // hand-rolled NoInfer, `data` failed to flow back into the generic
303 // indexed-access parameter `DataTypeToEntity[TDataType]`.
304 return data ? getLabel(props.dataType, data) : null
305 }
306
307 expectTypeOf(Test).toBeFunction()
308 })

Callers

nothing calls this directly

Calls 3

getDataFunction · 0.70
getLabelFunction · 0.70
useQueryFunction · 0.50

Tested by

no test coverage detected