Skip to content

Commit

Permalink
docs: gcTime max value (#7190)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazylace37 committed Apr 2, 2024
1 parent 9e70983 commit 0123c80
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/framework/react/plugins/persistQueryClient.md
Expand Up @@ -21,6 +21,8 @@ It should be set as the same value or higher than persistQueryClient's `maxAge`

You can also pass it `Infinity` to disable garbage collection behavior entirely.

Due to a Javascript limitation, the maximum allowed `gcTime` is about 24 days (see [more](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value)).

```tsx
const queryClient = new QueryClient({
defaultOptions: {
Expand Down
1 change: 1 addition & 0 deletions docs/framework/react/reference/useMutation.md
Expand Up @@ -51,6 +51,7 @@ mutate(variables, {
- `gcTime: number | Infinity`
- The time in milliseconds that unused/inactive cache data remains in memory. When a mutation's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different cache times are specified, the longest one will be used.
- If set to `Infinity`, will disable garbage collection
- Note: the maximum allowed time is about 24 days. See [more](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value).
- `mutationKey: unknown[]`
- Optional
- A mutation key can be set to inherit defaults set with `queryClient.setMutationDefaults`.
Expand Down
1 change: 1 addition & 0 deletions docs/framework/react/reference/useQuery.md
Expand Up @@ -96,6 +96,7 @@ const {
- `gcTime: number | Infinity`
- Defaults to `5 * 60 * 1000` (5 minutes) or `Infinity` during SSR
- The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used.
- Note: the maximum allowed time is about 24 days. See [more](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value).
- If set to `Infinity`, will disable garbage collection
- `queryKeyHashFn: (queryKey: QueryKey) => string`
- Optional
Expand Down

0 comments on commit 0123c80

Please sign in to comment.