forked from TanStack/query
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'beta' of https://github.com/TanStack/query into TanStac…
…k-beta * 'beta' of https://github.com/TanStack/query: (140 commits) Fix Best of JS badge in README (TanStack#3695) Update config.json docs: adapter teasers docs: rewrite typescript docs tests: stabilize docs: Update graphql.md to fix link (TanStack#3683) docs: fix link typo in README.md (TanStack#3679) Update README.md update readme Update config.json Update index.js examples: vendor to platform directories docs: migrate to tanstack.com fix(persist): introduce in-house synchronous Storage interface (TanStack#3673) docs: restructure migration guide by importance of breaking changes fix: `replaceDeepEqual` special case for non-plain arrays (TanStack#3669) feat: make InfiniteQueryObserver's type more robust (TanStack#3571) fix(types): remove non-void constraint from queryFn result (TanStack#3666) fix(persist): remove environment check (TanStack#3658) fix(types): make sure queryClient.setQueriesData can return undefined from the updater (TanStack#3657) ...
- Loading branch information
Showing
598 changed files
with
17,543 additions
and
24,446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
# Browsers we support | ||
> 0.5% | ||
Chrome >= 73 | ||
ChromeAndroid >= 75 | ||
Firefox >= 67 | ||
Edge >= 17 | ||
IE 11 | ||
Safari >= 12.1 | ||
iOS >= 11.3 | ||
Firefox >= 78 | ||
Edge >= 79 | ||
Safari >= 12.0 | ||
iOS >= 12.0 | ||
opera >= 53 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from '../lib/broadcastQueryClient-experimental' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../lib/broadcastQueryClient-experimental/index') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
testMatch: ['<rootDir>/**/*.test.js'], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import * as React from 'react' | ||
import { | ||
QueryCache, | ||
QueryClient, | ||
useInfiniteQuery, | ||
useIsFetching, | ||
useIsMutating, | ||
useMutation, | ||
useQueries, | ||
useQuery, | ||
useQueryClient, | ||
} from 'react-query' | ||
|
||
export const Examples = () => { | ||
useQuery('todos') | ||
useInfiniteQuery('todos') | ||
useMutation('todos') | ||
useIsFetching('todos') | ||
useIsMutating('todos') | ||
useQueries([query1, query2]) | ||
// QueryClient methods | ||
// --- Instantiated hook call. | ||
const queryClient = useQueryClient() | ||
queryClient.getMutationDefaults('todos') | ||
queryClient.getQueriesData('todos') | ||
queryClient.getQueryData('todos') | ||
queryClient.getQueryDefaults('todos') | ||
queryClient.getQueryState('todos') | ||
queryClient.isFetching('todos') | ||
queryClient.setMutationDefaults('todos', { mutationFn: async () => null }) | ||
queryClient.setQueriesData('todos', () => null) | ||
queryClient.setQueryData('todos', () => null) | ||
queryClient.setQueryDefaults('todos', { queryFn: async () => null }) | ||
queryClient.cancelQueries('todos') | ||
queryClient.fetchInfiniteQuery('todos') | ||
queryClient.fetchQuery('todos') | ||
queryClient.invalidateQueries('todos') | ||
queryClient.prefetchInfiniteQuery('todos') | ||
queryClient.prefetchQuery('todos') | ||
queryClient.refetchQueries('todos') | ||
queryClient.removeQueries('todos') | ||
queryClient.resetQueries('todos') | ||
// --- Direct hook call. | ||
useQueryClient().getMutationDefaults('todos') | ||
useQueryClient().getQueriesData('todos') | ||
useQueryClient().getQueryData('todos') | ||
useQueryClient().getQueryDefaults('todos') | ||
useQueryClient().getQueryState('todos') | ||
useQueryClient().isFetching('todos') | ||
useQueryClient().setMutationDefaults('todos', { | ||
mutationFn: async () => null, | ||
}) | ||
useQueryClient().setQueriesData('todos', () => null) | ||
useQueryClient().setQueryData('todos', () => null) | ||
useQueryClient().setQueryDefaults('todos', { queryFn: async () => null }) | ||
useQueryClient().cancelQueries('todos') | ||
useQueryClient().fetchInfiniteQuery('todos') | ||
useQueryClient().fetchQuery('todos') | ||
useQueryClient().invalidateQueries('todos') | ||
useQueryClient().prefetchInfiniteQuery('todos') | ||
useQueryClient().prefetchQuery('todos') | ||
useQueryClient().refetchQueries('todos') | ||
useQueryClient().removeQueries('todos') | ||
useQueryClient().resetQueries('todos') | ||
// QueryCache | ||
// --- NewExpression | ||
const queryCache1 = new QueryCache({ | ||
onError: (error) => console.log(error), | ||
onSuccess: (success) => console.log(success) | ||
}) | ||
queryCache1.find('todos') | ||
queryCache1.findAll('todos') | ||
// --- Instantiated hook call. | ||
const queryClient1 = useQueryClient() | ||
queryClient1.getQueryCache().find('todos') | ||
queryClient1.getQueryCache().findAll('todos') | ||
// | ||
const queryClient2 = new QueryClient({}) | ||
queryClient2.getQueryCache().find('todos') | ||
queryClient2.getQueryCache().findAll('todos') | ||
// | ||
const queryCache2 = queryClient1.getQueryCache() | ||
queryCache2.find('todos') | ||
queryCache2.findAll('todos') | ||
// --- Direct hook call. | ||
useQueryClient().getQueryCache().find('todos') | ||
useQueryClient().getQueryCache().findAll('todos') | ||
// | ||
const queryCache3 = useQueryClient().getQueryCache() | ||
queryCache3.find('todos') | ||
queryCache3.findAll('todos') | ||
|
||
return <div>Example Component</div> | ||
} |
Oops, something went wrong.