react-query#QueryResult TypeScript Examples

The following examples show how to use react-query#QueryResult. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: useCoaching.ts    From nyxo-app with GNU General Public License v3.0 5 votes vote down vote up
useListCoaching = (): QueryResult<CoachingItems | null> => {
  return useQuery('listCoaching', listCoaching)
}
Example #2
Source File: useCoaching.ts    From nyxo-app with GNU General Public License v3.0 5 votes vote down vote up
useGetCoaching = (
  id: string
): QueryResult<GetCoachingDataQuery['getCoachingData']> => {
  return useQuery(['coaching', { id }], getCoaching, {
    onSuccess: (data) => writeToStorage('coaching', data)
  })
}
Example #3
Source File: useCoaching.ts    From nyxo-app with GNU General Public License v3.0 5 votes vote down vote up
useGetActiveCoaching = (): QueryResult<CoachingPeriod | null> => {
  return useQuery('userActiveCoaching', getUserActiveCoaching, {
    onSuccess: (data) => writeToStorage('userActiveCoaching', data)
  })
}
Example #4
Source File: useUser.ts    From nyxo-app with GNU General Public License v3.0 5 votes vote down vote up
useGetUser = (): QueryResult<GetUserQuery['getUser']> => {
  return useQuery('user', getUserData, {
    onSuccess: (data) => writeToStorage('user', data)
  })
}
Example #5
Source File: useCoaching.ts    From nyxo-website with MIT License 5 votes vote down vote up
useListCoaching = (): QueryResult<
  ListCoachingDatasQuery["listCoachingDatas"]
> => {
  return useQuery("listCoaching", listCoaching)
}
Example #6
Source File: useUser.ts    From nyxo-website with MIT License 5 votes vote down vote up
useGetUser = (): QueryResult<GetUserQuery["getUser"]> => {
  return useQuery(["user"], getUserData)
}
Example #7
Source File: useUser.ts    From nyxo-website with MIT License 5 votes vote down vote up
useGetActiveCoaching = (): QueryResult<
  GetActiveCoachingQuery["getUser"]
> => {
  return useQuery("userActiveCoaching", getUserActiveCoaching)
}