@tanstack/react-query 5.0.0-alpha.86 → 5.0.0-alpha.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/HydrationBoundary.cjs +58 -0
- package/build/legacy/HydrationBoundary.cjs.map +1 -0
- package/build/legacy/HydrationBoundary.d.cts +12 -0
- package/build/legacy/HydrationBoundary.d.ts +12 -0
- package/build/legacy/HydrationBoundary.js +24 -0
- package/build/legacy/HydrationBoundary.js.map +1 -0
- package/build/legacy/QueryClientProvider.cjs +69 -0
- package/build/legacy/QueryClientProvider.cjs.map +1 -0
- package/build/legacy/QueryClientProvider.d.cts +12 -0
- package/build/legacy/QueryClientProvider.d.ts +12 -0
- package/build/legacy/QueryClientProvider.js +33 -0
- package/build/legacy/QueryClientProvider.js.map +1 -0
- package/build/legacy/QueryErrorResetBoundary.cjs +64 -0
- package/build/legacy/QueryErrorResetBoundary.cjs.map +1 -0
- package/build/legacy/QueryErrorResetBoundary.d.cts +14 -0
- package/build/legacy/QueryErrorResetBoundary.d.ts +14 -0
- package/build/legacy/QueryErrorResetBoundary.js +29 -0
- package/build/legacy/QueryErrorResetBoundary.js.map +1 -0
- package/build/legacy/errorBoundaryUtils.cjs +65 -0
- package/build/legacy/errorBoundaryUtils.cjs.map +1 -0
- package/build/legacy/errorBoundaryUtils.d.cts +14 -0
- package/build/legacy/errorBoundaryUtils.d.ts +14 -0
- package/build/{lib → legacy}/errorBoundaryUtils.js +10 -9
- package/build/legacy/errorBoundaryUtils.js.map +1 -0
- package/build/legacy/index.cjs +74 -0
- package/build/legacy/index.cjs.map +1 -0
- package/build/legacy/index.d.cts +14 -0
- package/build/legacy/index.d.ts +14 -0
- package/build/legacy/index.js +39 -0
- package/build/legacy/index.js.map +1 -0
- package/build/legacy/isRestoring.cjs +45 -0
- package/build/legacy/isRestoring.cjs.map +1 -0
- package/build/legacy/isRestoring.d.cts +6 -0
- package/build/legacy/isRestoring.d.ts +6 -0
- package/build/legacy/isRestoring.js +10 -0
- package/build/legacy/isRestoring.js.map +1 -0
- package/build/legacy/queryOptions.cjs +31 -0
- package/build/legacy/queryOptions.cjs.map +1 -0
- package/build/legacy/queryOptions.d.cts +13 -0
- package/build/legacy/queryOptions.d.ts +13 -0
- package/build/legacy/queryOptions.js +7 -0
- package/build/legacy/queryOptions.js.map +1 -0
- package/build/legacy/suspense.cjs +46 -0
- package/build/legacy/suspense.cjs.map +1 -0
- package/build/legacy/suspense.d.cts +10 -0
- package/build/legacy/suspense.d.ts +10 -0
- package/build/{lib/suspense.legacy.js → legacy/suspense.js} +10 -8
- package/build/legacy/suspense.js.map +1 -0
- package/build/legacy/types.cjs +17 -0
- package/build/legacy/types.cjs.map +1 -0
- package/build/legacy/types.d.cts +28 -0
- package/build/legacy/types.d.ts +28 -0
- package/build/legacy/types.js +1 -0
- package/build/legacy/types.js.map +1 -0
- package/build/legacy/useBaseQuery.cjs +90 -0
- package/build/legacy/useBaseQuery.cjs.map +1 -0
- package/build/legacy/useBaseQuery.d.cts +92 -0
- package/build/legacy/useBaseQuery.d.ts +92 -0
- package/build/legacy/useBaseQuery.js +60 -0
- package/build/legacy/useBaseQuery.js.map +1 -0
- package/build/legacy/useInfiniteQuery.cjs +39 -0
- package/build/legacy/useInfiniteQuery.cjs.map +1 -0
- package/build/legacy/useInfiniteQuery.d.cts +6 -0
- package/build/legacy/useInfiniteQuery.d.ts +6 -0
- package/build/legacy/useInfiniteQuery.js +15 -0
- package/build/legacy/useInfiniteQuery.js.map +1 -0
- package/build/legacy/useIsFetching.cjs +54 -0
- package/build/legacy/useIsFetching.cjs.map +1 -0
- package/build/legacy/useIsFetching.d.cts +5 -0
- package/build/legacy/useIsFetching.d.ts +5 -0
- package/build/legacy/useIsFetching.js +20 -0
- package/build/legacy/useIsFetching.js.map +1 -0
- package/build/legacy/useMutation.cjs +75 -0
- package/build/legacy/useMutation.cjs.map +1 -0
- package/build/legacy/useMutation.d.cts +6 -0
- package/build/legacy/useMutation.d.ts +6 -0
- package/build/legacy/useMutation.js +41 -0
- package/build/legacy/useMutation.js.map +1 -0
- package/build/legacy/useMutationState.cjs +86 -0
- package/build/legacy/useMutationState.cjs.map +1 -0
- package/build/legacy/useMutationState.d.cts +10 -0
- package/build/legacy/useMutationState.d.ts +10 -0
- package/build/legacy/useMutationState.js +51 -0
- package/build/legacy/useMutationState.js.map +1 -0
- package/build/legacy/useQueries.cjs +126 -0
- package/build/legacy/useQueries.cjs.map +1 -0
- package/build/legacy/useQueries.d.cts +53 -0
- package/build/{lib → legacy}/useQueries.d.ts +8 -7
- package/build/legacy/useQueries.js +101 -0
- package/build/legacy/useQueries.js.map +1 -0
- package/build/legacy/useQuery.cjs +34 -0
- package/build/legacy/useQuery.cjs.map +1 -0
- package/build/legacy/useQuery.d.cts +8 -0
- package/build/legacy/useQuery.d.ts +8 -0
- package/build/legacy/useQuery.js +10 -0
- package/build/legacy/useQuery.js.map +1 -0
- package/build/legacy/utils.cjs +34 -0
- package/build/legacy/utils.cjs.map +1 -0
- package/build/legacy/utils.d.cts +3 -0
- package/build/legacy/utils.d.ts +3 -0
- package/build/legacy/utils.js +10 -0
- package/build/legacy/utils.js.map +1 -0
- package/build/modern/HydrationBoundary.cjs +58 -0
- package/build/modern/HydrationBoundary.cjs.map +1 -0
- package/build/modern/HydrationBoundary.d.cts +12 -0
- package/build/modern/HydrationBoundary.d.ts +12 -0
- package/build/modern/HydrationBoundary.js +24 -0
- package/build/modern/HydrationBoundary.js.map +1 -0
- package/build/modern/QueryClientProvider.cjs +69 -0
- package/build/modern/QueryClientProvider.cjs.map +1 -0
- package/build/modern/QueryClientProvider.d.cts +12 -0
- package/build/modern/QueryClientProvider.d.ts +12 -0
- package/build/modern/QueryClientProvider.js +33 -0
- package/build/modern/QueryClientProvider.js.map +1 -0
- package/build/modern/QueryErrorResetBoundary.cjs +64 -0
- package/build/modern/QueryErrorResetBoundary.cjs.map +1 -0
- package/build/modern/QueryErrorResetBoundary.d.cts +14 -0
- package/build/modern/QueryErrorResetBoundary.d.ts +14 -0
- package/build/modern/QueryErrorResetBoundary.js +29 -0
- package/build/modern/QueryErrorResetBoundary.js.map +1 -0
- package/build/modern/errorBoundaryUtils.cjs +65 -0
- package/build/modern/errorBoundaryUtils.cjs.map +1 -0
- package/build/modern/errorBoundaryUtils.d.cts +14 -0
- package/build/modern/errorBoundaryUtils.d.ts +14 -0
- package/build/{lib/errorBoundaryUtils.legacy.js → modern/errorBoundaryUtils.js} +10 -9
- package/build/modern/errorBoundaryUtils.js.map +1 -0
- package/build/modern/index.cjs +74 -0
- package/build/modern/index.cjs.map +1 -0
- package/build/modern/index.d.cts +14 -0
- package/build/modern/index.d.ts +14 -0
- package/build/modern/index.js +39 -0
- package/build/modern/index.js.map +1 -0
- package/build/modern/isRestoring.cjs +45 -0
- package/build/modern/isRestoring.cjs.map +1 -0
- package/build/modern/isRestoring.d.cts +6 -0
- package/build/modern/isRestoring.d.ts +6 -0
- package/build/modern/isRestoring.js +10 -0
- package/build/modern/isRestoring.js.map +1 -0
- package/build/modern/queryOptions.cjs +31 -0
- package/build/modern/queryOptions.cjs.map +1 -0
- package/build/modern/queryOptions.d.cts +13 -0
- package/build/modern/queryOptions.d.ts +13 -0
- package/build/modern/queryOptions.js +7 -0
- package/build/modern/queryOptions.js.map +1 -0
- package/build/modern/suspense.cjs +46 -0
- package/build/modern/suspense.cjs.map +1 -0
- package/build/modern/suspense.d.cts +10 -0
- package/build/modern/suspense.d.ts +10 -0
- package/build/{lib → modern}/suspense.js +10 -8
- package/build/modern/suspense.js.map +1 -0
- package/build/modern/types.cjs +17 -0
- package/build/modern/types.cjs.map +1 -0
- package/build/modern/types.d.cts +28 -0
- package/build/modern/types.d.ts +28 -0
- package/build/modern/types.js +1 -0
- package/build/modern/types.js.map +1 -0
- package/build/modern/useBaseQuery.cjs +90 -0
- package/build/modern/useBaseQuery.cjs.map +1 -0
- package/build/modern/useBaseQuery.d.cts +92 -0
- package/build/modern/useBaseQuery.d.ts +92 -0
- package/build/modern/useBaseQuery.js +60 -0
- package/build/modern/useBaseQuery.js.map +1 -0
- package/build/modern/useInfiniteQuery.cjs +39 -0
- package/build/modern/useInfiniteQuery.cjs.map +1 -0
- package/build/modern/useInfiniteQuery.d.cts +6 -0
- package/build/modern/useInfiniteQuery.d.ts +6 -0
- package/build/modern/useInfiniteQuery.js +15 -0
- package/build/modern/useInfiniteQuery.js.map +1 -0
- package/build/modern/useIsFetching.cjs +54 -0
- package/build/modern/useIsFetching.cjs.map +1 -0
- package/build/modern/useIsFetching.d.cts +5 -0
- package/build/modern/useIsFetching.d.ts +5 -0
- package/build/modern/useIsFetching.js +20 -0
- package/build/modern/useIsFetching.js.map +1 -0
- package/build/modern/useMutation.cjs +75 -0
- package/build/modern/useMutation.cjs.map +1 -0
- package/build/modern/useMutation.d.cts +6 -0
- package/build/modern/useMutation.d.ts +6 -0
- package/build/modern/useMutation.js +41 -0
- package/build/modern/useMutation.js.map +1 -0
- package/build/modern/useMutationState.cjs +86 -0
- package/build/modern/useMutationState.cjs.map +1 -0
- package/build/modern/useMutationState.d.cts +10 -0
- package/build/modern/useMutationState.d.ts +10 -0
- package/build/modern/useMutationState.js +51 -0
- package/build/modern/useMutationState.js.map +1 -0
- package/build/modern/useQueries.cjs +123 -0
- package/build/modern/useQueries.cjs.map +1 -0
- package/build/modern/useQueries.d.cts +53 -0
- package/build/modern/useQueries.d.ts +53 -0
- package/build/modern/useQueries.js +98 -0
- package/build/modern/useQueries.js.map +1 -0
- package/build/modern/useQuery.cjs +34 -0
- package/build/modern/useQuery.cjs.map +1 -0
- package/build/modern/useQuery.d.cts +8 -0
- package/build/modern/useQuery.d.ts +8 -0
- package/build/modern/useQuery.js +10 -0
- package/build/modern/useQuery.js.map +1 -0
- package/build/modern/utils.cjs +34 -0
- package/build/modern/utils.cjs.map +1 -0
- package/build/modern/utils.d.cts +3 -0
- package/build/modern/utils.d.ts +3 -0
- package/build/modern/utils.js +10 -0
- package/build/modern/utils.js.map +1 -0
- package/package.json +19 -17
- package/build/codemods/__testfixtures__/default-import.input.tsx +0 -94
- package/build/codemods/__testfixtures__/default-import.output.tsx +0 -96
- package/build/codemods/__testfixtures__/named-import.input.tsx +0 -96
- package/build/codemods/__testfixtures__/named-import.output.tsx +0 -98
- package/build/codemods/__testfixtures__/namespaced-import.input.tsx +0 -86
- package/build/codemods/__testfixtures__/namespaced-import.output.tsx +0 -88
- package/build/codemods/__testfixtures__/parameter-is-identifier.input.tsx +0 -49
- package/build/codemods/__testfixtures__/parameter-is-identifier.output.tsx +0 -49
- package/build/codemods/__testfixtures__/parameter-is-object-expression.input.tsx +0 -128
- package/build/codemods/__testfixtures__/parameter-is-object-expression.output.tsx +0 -175
- package/build/codemods/__testfixtures__/replace-import-specifier.input.tsx +0 -10
- package/build/codemods/__testfixtures__/replace-import-specifier.output.tsx +0 -10
- package/build/codemods/__testfixtures__/type-arguments.input.tsx +0 -25
- package/build/codemods/__testfixtures__/type-arguments.output.tsx +0 -31
- package/build/codemods/__tests__/key-transformation.test.js +0 -32
- package/build/codemods/__tests__/replace-import-specifier.test.js +0 -12
- package/build/codemods/remove-overloads/__testfixtures__/default-import.input.tsx +0 -199
- package/build/codemods/remove-overloads/__testfixtures__/default-import.output.tsx +0 -484
- package/build/codemods/remove-overloads/__tests__/remove-overloads.test.js +0 -6
- package/build/lib/HydrationBoundary.cjs +0 -50
- package/build/lib/HydrationBoundary.cjs.map +0 -1
- package/build/lib/HydrationBoundary.d.ts +0 -10
- package/build/lib/HydrationBoundary.d.ts.map +0 -1
- package/build/lib/HydrationBoundary.js +0 -29
- package/build/lib/HydrationBoundary.js.map +0 -1
- package/build/lib/HydrationBoundary.legacy.cjs +0 -50
- package/build/lib/HydrationBoundary.legacy.cjs.map +0 -1
- package/build/lib/HydrationBoundary.legacy.js +0 -29
- package/build/lib/HydrationBoundary.legacy.js.map +0 -1
- package/build/lib/QueryClientProvider.cjs +0 -54
- package/build/lib/QueryClientProvider.cjs.map +0 -1
- package/build/lib/QueryClientProvider.d.ts +0 -10
- package/build/lib/QueryClientProvider.d.ts.map +0 -1
- package/build/lib/QueryClientProvider.js +0 -31
- package/build/lib/QueryClientProvider.js.map +0 -1
- package/build/lib/QueryClientProvider.legacy.cjs +0 -54
- package/build/lib/QueryClientProvider.legacy.cjs.map +0 -1
- package/build/lib/QueryClientProvider.legacy.js +0 -31
- package/build/lib/QueryClientProvider.legacy.js.map +0 -1
- package/build/lib/QueryErrorResetBoundary.cjs +0 -60
- package/build/lib/QueryErrorResetBoundary.cjs.map +0 -1
- package/build/lib/QueryErrorResetBoundary.d.ts +0 -12
- package/build/lib/QueryErrorResetBoundary.d.ts.map +0 -1
- package/build/lib/QueryErrorResetBoundary.js +0 -38
- package/build/lib/QueryErrorResetBoundary.js.map +0 -1
- package/build/lib/QueryErrorResetBoundary.legacy.cjs +0 -60
- package/build/lib/QueryErrorResetBoundary.legacy.cjs.map +0 -1
- package/build/lib/QueryErrorResetBoundary.legacy.js +0 -38
- package/build/lib/QueryErrorResetBoundary.legacy.js.map +0 -1
- package/build/lib/__tests__/HydrationBoundary.test.d.ts +0 -2
- package/build/lib/__tests__/HydrationBoundary.test.d.ts.map +0 -1
- package/build/lib/__tests__/QueryClientProvider.test.d.ts +0 -2
- package/build/lib/__tests__/QueryClientProvider.test.d.ts.map +0 -1
- package/build/lib/__tests__/QueryResetErrorBoundary.test.d.ts +0 -7
- package/build/lib/__tests__/QueryResetErrorBoundary.test.d.ts.map +0 -1
- package/build/lib/__tests__/ssr-hydration.test.d.ts +0 -2
- package/build/lib/__tests__/ssr-hydration.test.d.ts.map +0 -1
- package/build/lib/__tests__/ssr.test.d.ts +0 -2
- package/build/lib/__tests__/ssr.test.d.ts.map +0 -1
- package/build/lib/__tests__/suspense.test.d.ts +0 -2
- package/build/lib/__tests__/suspense.test.d.ts.map +0 -1
- package/build/lib/__tests__/useInfiniteQuery.test.d.ts +0 -2
- package/build/lib/__tests__/useInfiniteQuery.test.d.ts.map +0 -1
- package/build/lib/__tests__/useInfiniteQuery.type.test.d.ts +0 -2
- package/build/lib/__tests__/useInfiniteQuery.type.test.d.ts.map +0 -1
- package/build/lib/__tests__/useIsFetching.test.d.ts +0 -2
- package/build/lib/__tests__/useIsFetching.test.d.ts.map +0 -1
- package/build/lib/__tests__/useMutation.test.d.ts +0 -2
- package/build/lib/__tests__/useMutation.test.d.ts.map +0 -1
- package/build/lib/__tests__/useMutationState.test.d.ts +0 -2
- package/build/lib/__tests__/useMutationState.test.d.ts.map +0 -1
- package/build/lib/__tests__/useQueries.test.d.ts +0 -2
- package/build/lib/__tests__/useQueries.test.d.ts.map +0 -1
- package/build/lib/__tests__/useQuery.test.d.ts +0 -2
- package/build/lib/__tests__/useQuery.test.d.ts.map +0 -1
- package/build/lib/__tests__/useQuery.types.test.d.ts +0 -2
- package/build/lib/__tests__/useQuery.types.test.d.ts.map +0 -1
- package/build/lib/__tests__/utils.d.ts +0 -30
- package/build/lib/__tests__/utils.d.ts.map +0 -1
- package/build/lib/errorBoundaryUtils.cjs +0 -51
- package/build/lib/errorBoundaryUtils.cjs.map +0 -1
- package/build/lib/errorBoundaryUtils.d.ts +0 -11
- package/build/lib/errorBoundaryUtils.d.ts.map +0 -1
- package/build/lib/errorBoundaryUtils.js.map +0 -1
- package/build/lib/errorBoundaryUtils.legacy.cjs +0 -51
- package/build/lib/errorBoundaryUtils.legacy.cjs.map +0 -1
- package/build/lib/errorBoundaryUtils.legacy.js.map +0 -1
- package/build/lib/index.cjs +0 -40
- package/build/lib/index.cjs.map +0 -1
- package/build/lib/index.d.ts +0 -18
- package/build/lib/index.d.ts.map +0 -1
- package/build/lib/index.js +0 -13
- package/build/lib/index.js.map +0 -1
- package/build/lib/index.legacy.cjs +0 -40
- package/build/lib/index.legacy.cjs.map +0 -1
- package/build/lib/index.legacy.js +0 -13
- package/build/lib/index.legacy.js.map +0 -1
- package/build/lib/isRestoring.cjs +0 -31
- package/build/lib/isRestoring.cjs.map +0 -1
- package/build/lib/isRestoring.d.ts +0 -4
- package/build/lib/isRestoring.d.ts.map +0 -1
- package/build/lib/isRestoring.js +0 -9
- package/build/lib/isRestoring.js.map +0 -1
- package/build/lib/isRestoring.legacy.cjs +0 -31
- package/build/lib/isRestoring.legacy.cjs.map +0 -1
- package/build/lib/isRestoring.legacy.js +0 -9
- package/build/lib/isRestoring.legacy.js.map +0 -1
- package/build/lib/queryOptions.cjs +0 -8
- package/build/lib/queryOptions.cjs.map +0 -1
- package/build/lib/queryOptions.d.ts +0 -11
- package/build/lib/queryOptions.d.ts.map +0 -1
- package/build/lib/queryOptions.js +0 -6
- package/build/lib/queryOptions.js.map +0 -1
- package/build/lib/queryOptions.legacy.cjs +0 -8
- package/build/lib/queryOptions.legacy.cjs.map +0 -1
- package/build/lib/queryOptions.legacy.js +0 -6
- package/build/lib/queryOptions.legacy.js.map +0 -1
- package/build/lib/suspense.cjs +0 -22
- package/build/lib/suspense.cjs.map +0 -1
- package/build/lib/suspense.d.ts +0 -7
- package/build/lib/suspense.d.ts.map +0 -1
- package/build/lib/suspense.js.map +0 -1
- package/build/lib/suspense.legacy.cjs +0 -22
- package/build/lib/suspense.legacy.cjs.map +0 -1
- package/build/lib/suspense.legacy.js.map +0 -1
- package/build/lib/types.d.ts +0 -27
- package/build/lib/types.d.ts.map +0 -1
- package/build/lib/useBaseQuery.cjs +0 -80
- package/build/lib/useBaseQuery.cjs.map +0 -1
- package/build/lib/useBaseQuery.d.ts +0 -4
- package/build/lib/useBaseQuery.d.ts.map +0 -1
- package/build/lib/useBaseQuery.js +0 -59
- package/build/lib/useBaseQuery.js.map +0 -1
- package/build/lib/useBaseQuery.legacy.cjs +0 -80
- package/build/lib/useBaseQuery.legacy.cjs.map +0 -1
- package/build/lib/useBaseQuery.legacy.js +0 -59
- package/build/lib/useBaseQuery.legacy.js.map +0 -1
- package/build/lib/useInfiniteQuery.cjs +0 -15
- package/build/lib/useInfiniteQuery.cjs.map +0 -1
- package/build/lib/useInfiniteQuery.d.ts +0 -4
- package/build/lib/useInfiniteQuery.d.ts.map +0 -1
- package/build/lib/useInfiniteQuery.js +0 -13
- package/build/lib/useInfiniteQuery.js.map +0 -1
- package/build/lib/useInfiniteQuery.legacy.cjs +0 -15
- package/build/lib/useInfiniteQuery.legacy.cjs.map +0 -1
- package/build/lib/useInfiniteQuery.legacy.js +0 -13
- package/build/lib/useInfiniteQuery.legacy.js.map +0 -1
- package/build/lib/useIsFetching.cjs +0 -34
- package/build/lib/useIsFetching.cjs.map +0 -1
- package/build/lib/useIsFetching.d.ts +0 -3
- package/build/lib/useIsFetching.d.ts.map +0 -1
- package/build/lib/useIsFetching.js +0 -13
- package/build/lib/useIsFetching.js.map +0 -1
- package/build/lib/useIsFetching.legacy.cjs +0 -34
- package/build/lib/useIsFetching.legacy.cjs.map +0 -1
- package/build/lib/useIsFetching.legacy.js +0 -13
- package/build/lib/useIsFetching.legacy.js.map +0 -1
- package/build/lib/useMutation.cjs +0 -54
- package/build/lib/useMutation.cjs.map +0 -1
- package/build/lib/useMutation.d.ts +0 -4
- package/build/lib/useMutation.d.ts.map +0 -1
- package/build/lib/useMutation.js +0 -33
- package/build/lib/useMutation.js.map +0 -1
- package/build/lib/useMutation.legacy.cjs +0 -54
- package/build/lib/useMutation.legacy.cjs.map +0 -1
- package/build/lib/useMutation.legacy.js +0 -33
- package/build/lib/useMutation.legacy.js.map +0 -1
- package/build/lib/useMutationState.cjs +0 -60
- package/build/lib/useMutationState.cjs.map +0 -1
- package/build/lib/useMutationState.d.ts +0 -9
- package/build/lib/useMutationState.d.ts.map +0 -1
- package/build/lib/useMutationState.js +0 -38
- package/build/lib/useMutationState.js.map +0 -1
- package/build/lib/useMutationState.legacy.cjs +0 -60
- package/build/lib/useMutationState.legacy.cjs.map +0 -1
- package/build/lib/useMutationState.legacy.js +0 -38
- package/build/lib/useMutationState.legacy.js.map +0 -1
- package/build/lib/useQueries.cjs +0 -99
- package/build/lib/useQueries.cjs.map +0 -1
- package/build/lib/useQueries.d.ts.map +0 -1
- package/build/lib/useQueries.js +0 -78
- package/build/lib/useQueries.js.map +0 -1
- package/build/lib/useQueries.legacy.cjs +0 -102
- package/build/lib/useQueries.legacy.cjs.map +0 -1
- package/build/lib/useQueries.legacy.js +0 -81
- package/build/lib/useQueries.legacy.js.map +0 -1
- package/build/lib/useQuery.cjs +0 -14
- package/build/lib/useQuery.cjs.map +0 -1
- package/build/lib/useQuery.d.ts +0 -6
- package/build/lib/useQuery.d.ts.map +0 -1
- package/build/lib/useQuery.js +0 -12
- package/build/lib/useQuery.js.map +0 -1
- package/build/lib/useQuery.legacy.cjs +0 -14
- package/build/lib/useQuery.legacy.cjs.map +0 -1
- package/build/lib/useQuery.legacy.js +0 -12
- package/build/lib/useQuery.legacy.js.map +0 -1
- package/build/lib/utils.cjs +0 -12
- package/build/lib/utils.cjs.map +0 -1
- package/build/lib/utils.d.ts +0 -2
- package/build/lib/utils.d.ts.map +0 -1
- package/build/lib/utils.js +0 -10
- package/build/lib/utils.js.map +0 -1
- package/build/lib/utils.legacy.cjs +0 -12
- package/build/lib/utils.legacy.cjs.map +0 -1
- package/build/lib/utils.legacy.js +0 -10
- package/build/lib/utils.legacy.js.map +0 -1
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import * as RQ from 'react-query'
|
|
3
|
-
|
|
4
|
-
export const Examples = () => {
|
|
5
|
-
RQ.useQuery(['todos'])
|
|
6
|
-
RQ.useInfiniteQuery(['todos'])
|
|
7
|
-
RQ.useMutation(['todos'])
|
|
8
|
-
RQ.useIsFetching(['todos'])
|
|
9
|
-
RQ.useIsMutating(['todos'])
|
|
10
|
-
RQ.useQueries({
|
|
11
|
-
queries: [query1, query2]
|
|
12
|
-
})
|
|
13
|
-
// QueryClient methods
|
|
14
|
-
// --- Instantiated hook call.
|
|
15
|
-
const queryClient = RQ.useQueryClient()
|
|
16
|
-
queryClient.getMutationDefaults(['todos'])
|
|
17
|
-
queryClient.getQueriesData(['todos'])
|
|
18
|
-
queryClient.getQueryData(['todos'])
|
|
19
|
-
queryClient.getQueryDefaults(['todos'])
|
|
20
|
-
queryClient.getQueryState(['todos'])
|
|
21
|
-
queryClient.isFetching(['todos'])
|
|
22
|
-
queryClient.setMutationDefaults(['todos'], { mutationFn: async () => null })
|
|
23
|
-
queryClient.setQueriesData(['todos'], () => null)
|
|
24
|
-
queryClient.setQueryData(['todos'], () => null)
|
|
25
|
-
queryClient.setQueryDefaults(['todos'], { queryFn: async () => null })
|
|
26
|
-
queryClient.cancelQueries(['todos'])
|
|
27
|
-
queryClient.fetchInfiniteQuery(['todos'])
|
|
28
|
-
queryClient.fetchQuery(['todos'])
|
|
29
|
-
queryClient.invalidateQueries(['todos'])
|
|
30
|
-
queryClient.prefetchInfiniteQuery(['todos'])
|
|
31
|
-
queryClient.prefetchQuery(['todos'])
|
|
32
|
-
queryClient.refetchQueries(['todos'])
|
|
33
|
-
queryClient.removeQueries(['todos'])
|
|
34
|
-
queryClient.resetQueries(['todos'])
|
|
35
|
-
// --- Direct hook call.
|
|
36
|
-
RQ.useQueryClient().getMutationDefaults(['todos'])
|
|
37
|
-
RQ.useQueryClient().getQueriesData(['todos'])
|
|
38
|
-
RQ.useQueryClient().getQueryData(['todos'])
|
|
39
|
-
RQ.useQueryClient().getQueryDefaults(['todos'])
|
|
40
|
-
RQ.useQueryClient().getQueryState(['todos'])
|
|
41
|
-
RQ.useQueryClient().isFetching(['todos'])
|
|
42
|
-
RQ.useQueryClient().setMutationDefaults(['todos'], {
|
|
43
|
-
mutationFn: async () => null,
|
|
44
|
-
})
|
|
45
|
-
RQ.useQueryClient().setQueriesData(['todos'], () => null)
|
|
46
|
-
RQ.useQueryClient().setQueryData(['todos'], () => null)
|
|
47
|
-
RQ.useQueryClient().setQueryDefaults(['todos'], {
|
|
48
|
-
queryFn: async () => null,
|
|
49
|
-
})
|
|
50
|
-
RQ.useQueryClient().cancelQueries(['todos'])
|
|
51
|
-
RQ.useQueryClient().fetchInfiniteQuery(['todos'])
|
|
52
|
-
RQ.useQueryClient().fetchQuery(['todos'])
|
|
53
|
-
RQ.useQueryClient().invalidateQueries(['todos'])
|
|
54
|
-
RQ.useQueryClient().prefetchInfiniteQuery(['todos'])
|
|
55
|
-
RQ.useQueryClient().prefetchQuery(['todos'])
|
|
56
|
-
RQ.useQueryClient().refetchQueries(['todos'])
|
|
57
|
-
RQ.useQueryClient().removeQueries(['todos'])
|
|
58
|
-
RQ.useQueryClient().resetQueries(['todos'])
|
|
59
|
-
// QueryCache
|
|
60
|
-
// --- NewExpression
|
|
61
|
-
const queryCache1 = new RQ.QueryCache({
|
|
62
|
-
onError: (error) => console.log(error),
|
|
63
|
-
onSuccess: (success) => console.log(success)
|
|
64
|
-
})
|
|
65
|
-
queryCache1.find(['todos'])
|
|
66
|
-
queryCache1.findAll(['todos'])
|
|
67
|
-
// --- Instantiated hook call.
|
|
68
|
-
const queryClient1 = RQ.useQueryClient()
|
|
69
|
-
queryClient1.getQueryCache().find(['todos'])
|
|
70
|
-
queryClient1.getQueryCache().findAll(['todos'])
|
|
71
|
-
//
|
|
72
|
-
const queryClient2 = new RQ.QueryClient({})
|
|
73
|
-
queryClient2.getQueryCache().find(['todos'])
|
|
74
|
-
queryClient2.getQueryCache().findAll(['todos'])
|
|
75
|
-
//
|
|
76
|
-
const queryCache2 = queryClient1.getQueryCache()
|
|
77
|
-
queryCache2.find(['todos'])
|
|
78
|
-
queryCache2.findAll(['todos'])
|
|
79
|
-
// --- Direct hook call.
|
|
80
|
-
RQ.useQueryClient().getQueryCache().find(['todos'])
|
|
81
|
-
RQ.useQueryClient().getQueryCache().findAll(['todos'])
|
|
82
|
-
//
|
|
83
|
-
const queryCache3 = RQ.useQueryClient().getQueryCache()
|
|
84
|
-
queryCache3.find(['todos'])
|
|
85
|
-
queryCache3.findAll(['todos'])
|
|
86
|
-
|
|
87
|
-
return <div>Example Component</div>
|
|
88
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { useMutation, useQuery, useQueryClient } from 'react-query'
|
|
3
|
-
|
|
4
|
-
export const ExampleWithStringLiteralKey = () => {
|
|
5
|
-
const stringLiteralKey = 'todos'
|
|
6
|
-
useQuery(stringLiteralKey)
|
|
7
|
-
useMutation(stringLiteralKey)
|
|
8
|
-
// QueryClient methods
|
|
9
|
-
// --- Instantiated hook call.
|
|
10
|
-
const queryClient = useQueryClient()
|
|
11
|
-
queryClient.cancelQueries(stringLiteralKey)
|
|
12
|
-
// --- Direct hook call.
|
|
13
|
-
useQueryClient().cancelQueries(stringLiteralKey)
|
|
14
|
-
|
|
15
|
-
return <div>Example Component</div>
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const ExampleWithTemplateLiteral = () => {
|
|
19
|
-
const templateLiteralKey = `todos`
|
|
20
|
-
useQuery(templateLiteralKey)
|
|
21
|
-
useMutation(templateLiteralKey)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const ExampleWithArrayExpressionKey = () => {
|
|
25
|
-
const arrayExpressionKey = ['todos']
|
|
26
|
-
useQuery(arrayExpressionKey)
|
|
27
|
-
useMutation(arrayExpressionKey)
|
|
28
|
-
// QueryClient methods
|
|
29
|
-
// --- Instantiated hook call.
|
|
30
|
-
const queryClient = useQueryClient()
|
|
31
|
-
queryClient.cancelQueries(queryKey2)
|
|
32
|
-
// --- Direct hook call.
|
|
33
|
-
useQueryClient().cancelQueries(queryKey2)
|
|
34
|
-
|
|
35
|
-
return <div>Example Component</div>
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const ExampleWithUnknownKey = () => {
|
|
39
|
-
useQuery(unknownQueryKey)
|
|
40
|
-
useMutation(unknownQueryKey)
|
|
41
|
-
// QueryClient methods
|
|
42
|
-
// --- Instantiated hook call.
|
|
43
|
-
const queryClient = useQueryClient()
|
|
44
|
-
queryClient.cancelQueries(unknownQueryKey)
|
|
45
|
-
// --- Direct hook call.
|
|
46
|
-
useQueryClient().cancelQueries(unknownQueryKey)
|
|
47
|
-
|
|
48
|
-
return <div>Example Component</div>
|
|
49
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { useMutation, useQuery, useQueryClient } from 'react-query'
|
|
3
|
-
|
|
4
|
-
export const ExampleWithStringLiteralKey = () => {
|
|
5
|
-
const stringLiteralKey = 'todos'
|
|
6
|
-
useQuery([stringLiteralKey])
|
|
7
|
-
useMutation([stringLiteralKey])
|
|
8
|
-
// QueryClient methods
|
|
9
|
-
// --- Instantiated hook call.
|
|
10
|
-
const queryClient = useQueryClient()
|
|
11
|
-
queryClient.cancelQueries([stringLiteralKey])
|
|
12
|
-
// --- Direct hook call.
|
|
13
|
-
useQueryClient().cancelQueries([stringLiteralKey])
|
|
14
|
-
|
|
15
|
-
return <div>Example Component</div>
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const ExampleWithTemplateLiteral = () => {
|
|
19
|
-
const templateLiteralKey = `todos`
|
|
20
|
-
useQuery([templateLiteralKey])
|
|
21
|
-
useMutation([templateLiteralKey])
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const ExampleWithArrayExpressionKey = () => {
|
|
25
|
-
const arrayExpressionKey = ['todos']
|
|
26
|
-
useQuery(arrayExpressionKey)
|
|
27
|
-
useMutation(arrayExpressionKey)
|
|
28
|
-
// QueryClient methods
|
|
29
|
-
// --- Instantiated hook call.
|
|
30
|
-
const queryClient = useQueryClient()
|
|
31
|
-
queryClient.cancelQueries(queryKey2)
|
|
32
|
-
// --- Direct hook call.
|
|
33
|
-
useQueryClient().cancelQueries(queryKey2)
|
|
34
|
-
|
|
35
|
-
return <div>Example Component</div>
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const ExampleWithUnknownKey = () => {
|
|
39
|
-
useQuery(unknownQueryKey)
|
|
40
|
-
useMutation(unknownQueryKey)
|
|
41
|
-
// QueryClient methods
|
|
42
|
-
// --- Instantiated hook call.
|
|
43
|
-
const queryClient = useQueryClient()
|
|
44
|
-
queryClient.cancelQueries(unknownQueryKey)
|
|
45
|
-
// --- Direct hook call.
|
|
46
|
-
useQueryClient().cancelQueries(unknownQueryKey)
|
|
47
|
-
|
|
48
|
-
return <div>Example Component</div>
|
|
49
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { useMutation, useQuery, useQueryClient } from 'react-query'
|
|
3
|
-
|
|
4
|
-
const options = {}
|
|
5
|
-
|
|
6
|
-
export const ExampleWithStringLiteral = () => {
|
|
7
|
-
useQuery({ queryKey: 'todos', exact: true }, options)
|
|
8
|
-
useMutation({ mutationKey: 'todos', exact: true }, options)
|
|
9
|
-
// QueryClient methods
|
|
10
|
-
// --- Instantiated hook call.
|
|
11
|
-
const queryClient = useQueryClient()
|
|
12
|
-
queryClient.cancelQueries({ queryKey: 'todos', exact: true }, options)
|
|
13
|
-
// --- Direct hook call.
|
|
14
|
-
useQueryClient().cancelQueries({ queryKey: 'todos', exact: true }, options)
|
|
15
|
-
|
|
16
|
-
return <div>Example Component</div>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const ExampleWithStringLiteralIdentifier = () => {
|
|
20
|
-
const stringLiteralKey = 'todos'
|
|
21
|
-
useQuery({ queryKey: stringLiteralKey, exact: true }, options)
|
|
22
|
-
useMutation({ mutationKey: stringLiteralKey, exact: true }, options)
|
|
23
|
-
// QueryClient methods
|
|
24
|
-
// --- Instantiated hook call.
|
|
25
|
-
const queryClient = useQueryClient()
|
|
26
|
-
queryClient.cancelQueries({ queryKey: stringLiteralKey, exact: true }, options)
|
|
27
|
-
// --- Direct hook call.
|
|
28
|
-
useQueryClient().cancelQueries({ queryKey: stringLiteralKey, exact: true }, options)
|
|
29
|
-
|
|
30
|
-
return <div>Example Component</div>
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const ExampleWithTemplateLiteral = () => {
|
|
34
|
-
useQuery({ queryKey: `todos`, exact: true }, options)
|
|
35
|
-
useMutation({ mutationKey: `todos`, exact: true }, options)
|
|
36
|
-
// QueryClient methods
|
|
37
|
-
// --- Instantiated hook call.
|
|
38
|
-
const queryClient = useQueryClient()
|
|
39
|
-
queryClient.cancelQueries({ queryKey: `todos`, exact: true }, options)
|
|
40
|
-
// --- Direct hook call.
|
|
41
|
-
useQueryClient().cancelQueries({ queryKey: `todos`, exact: true }, options)
|
|
42
|
-
|
|
43
|
-
return <div>Example Component</div>
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const ExampleWithTemplateLiteralIdentifier = () => {
|
|
47
|
-
const templateLiteralKey = `todos`
|
|
48
|
-
useQuery({ queryKey: templateLiteralKey, exact: true }, options)
|
|
49
|
-
useMutation({ mutationKey: templateLiteralKey, exact: true }, options)
|
|
50
|
-
// QueryClient methods
|
|
51
|
-
// --- Instantiated hook call.
|
|
52
|
-
const queryClient = useQueryClient()
|
|
53
|
-
queryClient.cancelQueries({ queryKey: templateLiteralKey, exact: true }, options)
|
|
54
|
-
// --- Direct hook call.
|
|
55
|
-
useQueryClient().cancelQueries({ queryKey: templateLiteralKey, exact: true }, options)
|
|
56
|
-
|
|
57
|
-
return <div>Example Component</div>
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const ExampleWithArrayExpression = () => {
|
|
61
|
-
useQuery({ queryKey: ['todos'], exact: true }, options)
|
|
62
|
-
useMutation({ mutationKey: ['todos'], exact: true }, options)
|
|
63
|
-
// QueryClient methods
|
|
64
|
-
// --- Instantiated hook call.
|
|
65
|
-
const queryClient = useQueryClient()
|
|
66
|
-
queryClient.cancelQueries({ queryKey: ['todos'], exact: true }, options)
|
|
67
|
-
// --- Direct hook call.
|
|
68
|
-
useQueryClient().cancelQueries({ queryKey: ['todos'], exact: true }, options)
|
|
69
|
-
|
|
70
|
-
return <div>Example Component</div>
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const ExampleWithArrayExpressionIdentifier = () => {
|
|
74
|
-
const arrayExpressionKey = ['todos']
|
|
75
|
-
useQuery({ queryKey: arrayExpressionKey, exact: true }, options)
|
|
76
|
-
useMutation({ mutationKey: arrayExpressionKey, exact: true }, options)
|
|
77
|
-
// QueryClient methods
|
|
78
|
-
// --- Instantiated hook call.
|
|
79
|
-
const queryClient = useQueryClient()
|
|
80
|
-
queryClient.cancelQueries({ queryKey: arrayExpressionKey, exact: true }, options)
|
|
81
|
-
// --- Direct hook call.
|
|
82
|
-
useQueryClient().cancelQueries({ queryKey: arrayExpressionKey, exact: true }, options)
|
|
83
|
-
|
|
84
|
-
return <div>Example Component</div>
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export const ExampleWithUnknownIdentifier1 = () => {
|
|
88
|
-
const createKey = (id) => ['todos', id]
|
|
89
|
-
const createdKey1 = createKey(1)
|
|
90
|
-
useQuery({ queryKey: createdKey1, exact: true }, options)
|
|
91
|
-
useMutation({ mutationKey: createdKey1, exact: true }, options)
|
|
92
|
-
// QueryClient methods
|
|
93
|
-
// --- Instantiated hook call.
|
|
94
|
-
const queryClient = useQueryClient()
|
|
95
|
-
queryClient.cancelQueries({ queryKey: createdKey1, exact: true }, options)
|
|
96
|
-
// --- Direct hook call.
|
|
97
|
-
useQueryClient().cancelQueries({ queryKey: createdKey1, exact: true }, options)
|
|
98
|
-
|
|
99
|
-
return <div>Example Component</div>
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export const ExampleWithUnknownIdentifier2 = () => {
|
|
103
|
-
const createdKey2 = createKey()
|
|
104
|
-
useQuery({ queryKey: createdKey2, exact: true }, options)
|
|
105
|
-
useMutation({ mutationKey: createdKey2, exact: true }, options)
|
|
106
|
-
// QueryClient methods
|
|
107
|
-
// --- Instantiated hook call.
|
|
108
|
-
const queryClient = useQueryClient()
|
|
109
|
-
queryClient.cancelQueries({ queryKey: createdKey2, exact: true }, options)
|
|
110
|
-
// --- Direct hook call.
|
|
111
|
-
useQueryClient().cancelQueries({ queryKey: createdKey2, exact: true }, options)
|
|
112
|
-
|
|
113
|
-
return <div>Example Component</div>
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export const ExampleWithUnknownIdentifier3 = () => {
|
|
117
|
-
useQuery({ queryKey: unknownQueryKey, exact: true }, options)
|
|
118
|
-
useMutation({ mutationKey: unknownQueryKey, exact: true }, options)
|
|
119
|
-
// QueryClient methods
|
|
120
|
-
// --- Instantiated hook call.
|
|
121
|
-
const queryClient = useQueryClient()
|
|
122
|
-
queryClient.cancelQueries({ queryKey: unknownQueryKey, exact: true }, options)
|
|
123
|
-
// --- Direct hook call.
|
|
124
|
-
useQueryClient().cancelQueries({ queryKey: unknownQueryKey, exact: true }, options)
|
|
125
|
-
|
|
126
|
-
return <div>Example Component</div>
|
|
127
|
-
}
|
|
128
|
-
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { useMutation, useQuery, useQueryClient } from 'react-query'
|
|
3
|
-
|
|
4
|
-
const options = {}
|
|
5
|
-
|
|
6
|
-
export const ExampleWithStringLiteral = () => {
|
|
7
|
-
useQuery({
|
|
8
|
-
queryKey: ['todos'],
|
|
9
|
-
exact: true
|
|
10
|
-
}, options)
|
|
11
|
-
useMutation({
|
|
12
|
-
mutationKey: ['todos'],
|
|
13
|
-
exact: true
|
|
14
|
-
}, options)
|
|
15
|
-
// QueryClient methods
|
|
16
|
-
// --- Instantiated hook call.
|
|
17
|
-
const queryClient = useQueryClient()
|
|
18
|
-
queryClient.cancelQueries({
|
|
19
|
-
queryKey: ['todos'],
|
|
20
|
-
exact: true
|
|
21
|
-
}, options)
|
|
22
|
-
// --- Direct hook call.
|
|
23
|
-
useQueryClient().cancelQueries({
|
|
24
|
-
queryKey: ['todos'],
|
|
25
|
-
exact: true
|
|
26
|
-
}, options)
|
|
27
|
-
|
|
28
|
-
return <div>Example Component</div>
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const ExampleWithStringLiteralIdentifier = () => {
|
|
32
|
-
const stringLiteralKey = 'todos'
|
|
33
|
-
useQuery({
|
|
34
|
-
queryKey: [stringLiteralKey],
|
|
35
|
-
exact: true
|
|
36
|
-
}, options)
|
|
37
|
-
useMutation({
|
|
38
|
-
mutationKey: [stringLiteralKey],
|
|
39
|
-
exact: true
|
|
40
|
-
}, options)
|
|
41
|
-
// QueryClient methods
|
|
42
|
-
// --- Instantiated hook call.
|
|
43
|
-
const queryClient = useQueryClient()
|
|
44
|
-
queryClient.cancelQueries({
|
|
45
|
-
queryKey: [stringLiteralKey],
|
|
46
|
-
exact: true
|
|
47
|
-
}, options)
|
|
48
|
-
// --- Direct hook call.
|
|
49
|
-
useQueryClient().cancelQueries({
|
|
50
|
-
queryKey: [stringLiteralKey],
|
|
51
|
-
exact: true
|
|
52
|
-
}, options)
|
|
53
|
-
|
|
54
|
-
return <div>Example Component</div>
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const ExampleWithTemplateLiteral = () => {
|
|
58
|
-
useQuery({
|
|
59
|
-
queryKey: [`todos`],
|
|
60
|
-
exact: true
|
|
61
|
-
}, options)
|
|
62
|
-
useMutation({
|
|
63
|
-
mutationKey: [`todos`],
|
|
64
|
-
exact: true
|
|
65
|
-
}, options)
|
|
66
|
-
// QueryClient methods
|
|
67
|
-
// --- Instantiated hook call.
|
|
68
|
-
const queryClient = useQueryClient()
|
|
69
|
-
queryClient.cancelQueries({
|
|
70
|
-
queryKey: [`todos`],
|
|
71
|
-
exact: true
|
|
72
|
-
}, options)
|
|
73
|
-
// --- Direct hook call.
|
|
74
|
-
useQueryClient().cancelQueries({
|
|
75
|
-
queryKey: [`todos`],
|
|
76
|
-
exact: true
|
|
77
|
-
}, options)
|
|
78
|
-
|
|
79
|
-
return <div>Example Component</div>
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export const ExampleWithTemplateLiteralIdentifier = () => {
|
|
83
|
-
const templateLiteralKey = `todos`
|
|
84
|
-
useQuery({
|
|
85
|
-
queryKey: [templateLiteralKey],
|
|
86
|
-
exact: true
|
|
87
|
-
}, options)
|
|
88
|
-
useMutation({
|
|
89
|
-
mutationKey: [templateLiteralKey],
|
|
90
|
-
exact: true
|
|
91
|
-
}, options)
|
|
92
|
-
// QueryClient methods
|
|
93
|
-
// --- Instantiated hook call.
|
|
94
|
-
const queryClient = useQueryClient()
|
|
95
|
-
queryClient.cancelQueries({
|
|
96
|
-
queryKey: [templateLiteralKey],
|
|
97
|
-
exact: true
|
|
98
|
-
}, options)
|
|
99
|
-
// --- Direct hook call.
|
|
100
|
-
useQueryClient().cancelQueries({
|
|
101
|
-
queryKey: [templateLiteralKey],
|
|
102
|
-
exact: true
|
|
103
|
-
}, options)
|
|
104
|
-
|
|
105
|
-
return <div>Example Component</div>
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export const ExampleWithArrayExpression = () => {
|
|
109
|
-
useQuery({ queryKey: ['todos'], exact: true }, options)
|
|
110
|
-
useMutation({ mutationKey: ['todos'], exact: true }, options)
|
|
111
|
-
// QueryClient methods
|
|
112
|
-
// --- Instantiated hook call.
|
|
113
|
-
const queryClient = useQueryClient()
|
|
114
|
-
queryClient.cancelQueries({ queryKey: ['todos'], exact: true }, options)
|
|
115
|
-
// --- Direct hook call.
|
|
116
|
-
useQueryClient().cancelQueries({ queryKey: ['todos'], exact: true }, options)
|
|
117
|
-
|
|
118
|
-
return <div>Example Component</div>
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export const ExampleWithArrayExpressionIdentifier = () => {
|
|
122
|
-
const arrayExpressionKey = ['todos']
|
|
123
|
-
useQuery({ queryKey: arrayExpressionKey, exact: true }, options)
|
|
124
|
-
useMutation({ mutationKey: arrayExpressionKey, exact: true }, options)
|
|
125
|
-
// QueryClient methods
|
|
126
|
-
// --- Instantiated hook call.
|
|
127
|
-
const queryClient = useQueryClient()
|
|
128
|
-
queryClient.cancelQueries({ queryKey: arrayExpressionKey, exact: true }, options)
|
|
129
|
-
// --- Direct hook call.
|
|
130
|
-
useQueryClient().cancelQueries({ queryKey: arrayExpressionKey, exact: true }, options)
|
|
131
|
-
|
|
132
|
-
return <div>Example Component</div>
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export const ExampleWithUnknownIdentifier1 = () => {
|
|
136
|
-
const createKey = (id) => ['todos', id]
|
|
137
|
-
const createdKey1 = createKey(1)
|
|
138
|
-
useQuery({ queryKey: createdKey1, exact: true }, options)
|
|
139
|
-
useMutation({ mutationKey: createdKey1, exact: true }, options)
|
|
140
|
-
// QueryClient methods
|
|
141
|
-
// --- Instantiated hook call.
|
|
142
|
-
const queryClient = useQueryClient()
|
|
143
|
-
queryClient.cancelQueries({ queryKey: createdKey1, exact: true }, options)
|
|
144
|
-
// --- Direct hook call.
|
|
145
|
-
useQueryClient().cancelQueries({ queryKey: createdKey1, exact: true }, options)
|
|
146
|
-
|
|
147
|
-
return <div>Example Component</div>
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export const ExampleWithUnknownIdentifier2 = () => {
|
|
151
|
-
const createdKey2 = createKey()
|
|
152
|
-
useQuery({ queryKey: createdKey2, exact: true }, options)
|
|
153
|
-
useMutation({ mutationKey: createdKey2, exact: true }, options)
|
|
154
|
-
// QueryClient methods
|
|
155
|
-
// --- Instantiated hook call.
|
|
156
|
-
const queryClient = useQueryClient()
|
|
157
|
-
queryClient.cancelQueries({ queryKey: createdKey2, exact: true }, options)
|
|
158
|
-
// --- Direct hook call.
|
|
159
|
-
useQueryClient().cancelQueries({ queryKey: createdKey2, exact: true }, options)
|
|
160
|
-
|
|
161
|
-
return <div>Example Component</div>
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export const ExampleWithUnknownIdentifier3 = () => {
|
|
165
|
-
useQuery({ queryKey: unknownQueryKey, exact: true }, options)
|
|
166
|
-
useMutation({ mutationKey: unknownQueryKey, exact: true }, options)
|
|
167
|
-
// QueryClient methods
|
|
168
|
-
// --- Instantiated hook call.
|
|
169
|
-
const queryClient = useQueryClient()
|
|
170
|
-
queryClient.cancelQueries({ queryKey: unknownQueryKey, exact: true }, options)
|
|
171
|
-
// --- Direct hook call.
|
|
172
|
-
useQueryClient().cancelQueries({ queryKey: unknownQueryKey, exact: true }, options)
|
|
173
|
-
|
|
174
|
-
return <div>Example Component</div>
|
|
175
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// React Query
|
|
2
|
-
import { useQuery, useQueryClient } from 'react-query'
|
|
3
|
-
import { useQuery as RenamedUseQuery, useQueryClient as RenamedUseQueryClient } from 'react-query'
|
|
4
|
-
import DefaultReactQuery from 'react-query'
|
|
5
|
-
import * as NamespacedReactQuery from 'react-query'
|
|
6
|
-
// Devtools
|
|
7
|
-
import { ReactQueryDevtools } from 'react-query/devtools'
|
|
8
|
-
import { ReactQueryDevtools as RenamedReactQueryDevtools } from 'react-query/devtools'
|
|
9
|
-
import DefaultReactQueryDevtools from 'react-query/devtools'
|
|
10
|
-
import * as NamespacedReactQueryDevtools from 'react-query/devtools'
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// React Query
|
|
2
|
-
import { useQuery, useQueryClient } from '@tanstack/react-query'
|
|
3
|
-
import { useQuery as RenamedUseQuery, useQueryClient as RenamedUseQueryClient } from '@tanstack/react-query'
|
|
4
|
-
import DefaultReactQuery from '@tanstack/react-query'
|
|
5
|
-
import * as NamespacedReactQuery from '@tanstack/react-query'
|
|
6
|
-
// Devtools
|
|
7
|
-
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
|
|
8
|
-
import { ReactQueryDevtools as RenamedReactQueryDevtools } from '@tanstack/react-query-devtools'
|
|
9
|
-
import DefaultReactQueryDevtools from '@tanstack/react-query-devtools'
|
|
10
|
-
import * as NamespacedReactQueryDevtools from '@tanstack/react-query-devtools'
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { useQueries, useQuery, useQueryClient } from 'react-query'
|
|
3
|
-
|
|
4
|
-
type Todos = {
|
|
5
|
-
items: readonly {
|
|
6
|
-
id: string
|
|
7
|
-
text: string
|
|
8
|
-
}[]
|
|
9
|
-
ts: number
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const Examples = () => {
|
|
13
|
-
useQuery<Todos>('todos')
|
|
14
|
-
useQueries<Array<Todos>>([query1, query2])
|
|
15
|
-
// QueryClient methods
|
|
16
|
-
// --- Instantiated hook call.
|
|
17
|
-
const queryClient = useQueryClient()
|
|
18
|
-
queryClient.getQueriesData<Todos>('todos')
|
|
19
|
-
queryClient.getQueriesData<Todos>({ queryKey: 'todos' })
|
|
20
|
-
// --- Direct hook call.
|
|
21
|
-
useQueryClient().getQueriesData<Todos>('todos')
|
|
22
|
-
useQueryClient().getQueriesData<Todos>({ queryKey: 'todos' })
|
|
23
|
-
|
|
24
|
-
return <div>Example Component</div>
|
|
25
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { useQueries, useQuery, useQueryClient } from 'react-query'
|
|
3
|
-
|
|
4
|
-
type Todos = {
|
|
5
|
-
items: readonly {
|
|
6
|
-
id: string
|
|
7
|
-
text: string
|
|
8
|
-
}[]
|
|
9
|
-
ts: number
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const Examples = () => {
|
|
13
|
-
useQuery<Todos>(['todos'])
|
|
14
|
-
useQueries<Array<Todos>>({
|
|
15
|
-
queries: [query1, query2]
|
|
16
|
-
})
|
|
17
|
-
// QueryClient methods
|
|
18
|
-
// --- Instantiated hook call.
|
|
19
|
-
const queryClient = useQueryClient()
|
|
20
|
-
queryClient.getQueriesData<Todos>(['todos'])
|
|
21
|
-
queryClient.getQueriesData<Todos>({
|
|
22
|
-
queryKey: ['todos']
|
|
23
|
-
})
|
|
24
|
-
// --- Direct hook call.
|
|
25
|
-
useQueryClient().getQueriesData<Todos>(['todos'])
|
|
26
|
-
useQueryClient().getQueriesData<Todos>({
|
|
27
|
-
queryKey: ['todos']
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
return <div>Example Component</div>
|
|
31
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2
|
-
const defineTest = require('jscodeshift/dist/testUtils').defineTest
|
|
3
|
-
|
|
4
|
-
defineTest(__dirname, 'key-transformation', null, 'default-import', {
|
|
5
|
-
parser: 'tsx',
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
defineTest(__dirname, 'key-transformation', null, 'named-import', {
|
|
9
|
-
parser: 'tsx',
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
defineTest(__dirname, 'key-transformation', null, 'namespaced-import', {
|
|
13
|
-
parser: 'tsx',
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
defineTest(__dirname, 'key-transformation', null, 'parameter-is-identifier', {
|
|
17
|
-
parser: 'tsx',
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
defineTest(
|
|
21
|
-
__dirname,
|
|
22
|
-
'key-transformation',
|
|
23
|
-
null,
|
|
24
|
-
'parameter-is-object-expression',
|
|
25
|
-
{
|
|
26
|
-
parser: 'tsx',
|
|
27
|
-
},
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
defineTest(__dirname, 'key-transformation', null, 'type-arguments', {
|
|
31
|
-
parser: 'tsx',
|
|
32
|
-
})
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2
|
-
const defineTest = require('jscodeshift/dist/testUtils').defineTest
|
|
3
|
-
|
|
4
|
-
defineTest(
|
|
5
|
-
__dirname,
|
|
6
|
-
'replace-import-specifier',
|
|
7
|
-
null,
|
|
8
|
-
'replace-import-specifier',
|
|
9
|
-
{
|
|
10
|
-
parser: 'tsx',
|
|
11
|
-
},
|
|
12
|
-
)
|