-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/alpha' into serverInfinite
- Loading branch information
Showing
198 changed files
with
10,289 additions
and
5,636 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
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 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,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> | ||
} |
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,96 @@ | ||
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({ | ||
queries: [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> | ||
} |
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,96 @@ | ||
import * as React from 'react' | ||
import { | ||
QueryCache as RenamedQueryCache, | ||
QueryClient as RenamedQueryClient, | ||
useInfiniteQuery as useRenamedInfiniteQuery, | ||
useIsFetching as useRenamedIsFetching, | ||
useIsMutating as useRenamedIsMutating, | ||
useMutation as useRenamedMutation, | ||
useQueries as useRenamedQueries, | ||
useQuery as useRenamedQuery, | ||
useQueryClient as useRenamedQueryClient, | ||
} from 'react-query' | ||
|
||
export const Examples = () => { | ||
useRenamedQuery('todos') | ||
useRenamedInfiniteQuery('todos') | ||
useRenamedMutation('todos') | ||
useRenamedIsFetching('todos') | ||
useRenamedIsMutating('todos') | ||
useRenamedQueries([query1, query2]) | ||
// QueryClient methods | ||
// --- Instantiated hook call. | ||
const queryClient = useRenamedQueryClient() | ||
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. | ||
useRenamedQueryClient().getMutationDefaults('todos') | ||
useRenamedQueryClient().getQueriesData('todos') | ||
useRenamedQueryClient().getQueryData('todos') | ||
useRenamedQueryClient().getQueryDefaults('todos') | ||
useRenamedQueryClient().getQueryState('todos') | ||
useRenamedQueryClient().isFetching('todos') | ||
useRenamedQueryClient().setMutationDefaults('todos', { | ||
mutationFn: async () => null, | ||
}) | ||
useRenamedQueryClient().setQueriesData('todos', () => null) | ||
useRenamedQueryClient().setQueryData('todos', () => null) | ||
useRenamedQueryClient().setQueryDefaults('todos', { | ||
queryFn: async () => null, | ||
}) | ||
useRenamedQueryClient().cancelQueries('todos') | ||
useRenamedQueryClient().fetchInfiniteQuery('todos') | ||
useRenamedQueryClient().fetchQuery('todos') | ||
useRenamedQueryClient().invalidateQueries('todos') | ||
useRenamedQueryClient().prefetchInfiniteQuery('todos') | ||
useRenamedQueryClient().prefetchQuery('todos') | ||
useRenamedQueryClient().refetchQueries('todos') | ||
useRenamedQueryClient().removeQueries('todos') | ||
useRenamedQueryClient().resetQueries('todos') | ||
// QueryCache | ||
// --- NewExpression | ||
const queryCache1 = new RenamedQueryCache({ | ||
onError: (error) => console.log(error), | ||
onSuccess: (success) => console.log(success) | ||
}) | ||
queryCache1.find('todos') | ||
queryCache1.findAll('todos') | ||
// --- Instantiated hook call. | ||
const queryClient1 = useRenamedQueryClient() | ||
queryClient1.getQueryCache().find('todos') | ||
queryClient1.getQueryCache().findAll('todos') | ||
// | ||
const queryClient2 = new RenamedQueryClient({}) | ||
queryClient2.getQueryCache().find('todos') | ||
queryClient2.getQueryCache().findAll('todos') | ||
// | ||
const queryCache2 = queryClient1.getQueryCache() | ||
queryCache2.find('todos') | ||
queryCache2.findAll('todos') | ||
// --- Direct hook call. | ||
useRenamedQueryClient().getQueryCache().find('todos') | ||
useRenamedQueryClient().getQueryCache().findAll('todos') | ||
// | ||
const queryCache3 = useRenamedQueryClient().getQueryCache() | ||
queryCache3.find('todos') | ||
queryCache3.findAll('todos') | ||
|
||
return <div>Example Component</div> | ||
} |
Oops, something went wrong.