From dc82da0cd4535c51a1fbcaaf269109245fe6097c Mon Sep 17 00:00:00 2001 From: Damian Osipiuk Date: Tue, 27 Dec 2022 21:48:16 +0100 Subject: [PATCH] docs: fix TanStack casing --- .github/ISSUE_TEMPLATE/bug_report.yml | 4 ++-- docs/react/guides/custom-logger.md | 2 +- docs/react/guides/default-query-function.md | 2 +- docs/react/guides/disabling-queries.md | 2 +- .../guides/does-this-replace-client-state.md | 16 ++++++++-------- docs/react/guides/filters.md | 2 +- docs/react/guides/important-defaults.md | 4 ++-- docs/react/guides/infinite-queries.md | 2 +- docs/react/guides/mutations.md | 4 ++-- docs/react/guides/network-mode.md | 12 ++++++------ docs/react/guides/paginated-queries.md | 4 ++-- docs/react/guides/parallel-queries.md | 4 ++-- docs/react/guides/query-cancellation.md | 8 ++++---- docs/react/guides/query-functions.md | 4 ++-- docs/react/guides/query-invalidation.md | 2 +- docs/react/guides/query-keys.md | 2 +- docs/react/guides/query-retries.md | 4 ++-- docs/react/guides/scroll-restoration.md | 4 ++-- docs/react/guides/window-focus-refetching.md | 4 ++-- docs/react/reference/QueryCache.md | 2 +- docs/react/reference/QueryClient.md | 4 ++-- docs/react/reference/focusManager.md | 2 +- docs/react/reference/onlineManager.md | 2 +- examples/react/basic-graphql-request/index.html | 2 +- examples/react/basic-typescript/index.html | 2 +- examples/react/basic/index.html | 2 +- examples/react/default-query-function/index.html | 2 +- examples/react/offline/index.html | 2 +- examples/react/playground/index.html | 2 +- examples/react/react-router/index.html | 2 +- examples/react/rick-morty/index.html | 2 +- examples/react/simple/index.html | 2 +- examples/react/star-wars/index.html | 2 +- examples/react/suspense/index.html | 2 +- 34 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 01c34dc93e..817bb0a377 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -98,9 +98,9 @@ body: - type: input id: rq-version attributes: - label: Tanstack Query version + label: TanStack Query version description: | - Please let us know the exact version of Tanstack Query you were using when the issue occurred. Please don't just put in "latest", as this is subject to change. + Please let us know the exact version of TanStack Query you were using when the issue occurred. Please don't just put in "latest", as this is subject to change. placeholder: | e.g. v3.30.1 validations: diff --git a/docs/react/guides/custom-logger.md b/docs/react/guides/custom-logger.md index a4c075520b..6213d3f18f 100644 --- a/docs/react/guides/custom-logger.md +++ b/docs/react/guides/custom-logger.md @@ -3,7 +3,7 @@ id: custom-logger title: Custom Logger --- -If you want to change how information is logged by Tanstack Query, you can set a custom logger when creating a `QueryClient`. +If you want to change how information is logged by TanStack Query, you can set a custom logger when creating a `QueryClient`. ```tsx const queryClient = new QueryClient({ diff --git a/docs/react/guides/default-query-function.md b/docs/react/guides/default-query-function.md index 78ee0eb2b8..d670e4a909 100644 --- a/docs/react/guides/default-query-function.md +++ b/docs/react/guides/default-query-function.md @@ -3,7 +3,7 @@ id: default-query-function title: Default Query Function --- -If you find yourself wishing for whatever reason that you could just share the same query function for your entire app and just use query keys to identify what it should fetch, you can do that by providing a **default query function** to Tanstack Query: +If you find yourself wishing for whatever reason that you could just share the same query function for your entire app and just use query keys to identify what it should fetch, you can do that by providing a **default query function** to TanStack Query: [//]: # 'Example' diff --git a/docs/react/guides/disabling-queries.md b/docs/react/guides/disabling-queries.md index 2ec1e04755..d848bd379d 100644 --- a/docs/react/guides/disabling-queries.md +++ b/docs/react/guides/disabling-queries.md @@ -53,7 +53,7 @@ function Todos() { [//]: # 'Example' -Permanently disabling a query opts out of many great features that Tanstack Query has to offer (like background refetches), and it's also not the idiomatic way. It takes you from the declarative approach (defining dependencies when your query should run) into an imperative mode (fetch whenever I click here). It is also not possible to pass parameters to `refetch`. Oftentimes, all you want is a lazy query that defers the initial fetch: +Permanently disabling a query opts out of many great features that TanStack Query has to offer (like background refetches), and it's also not the idiomatic way. It takes you from the declarative approach (defining dependencies when your query should run) into an imperative mode (fetch whenever I click here). It is also not possible to pass parameters to `refetch`. Oftentimes, all you want is a lazy query that defers the initial fetch: ## Lazy Queries diff --git a/docs/react/guides/does-this-replace-client-state.md b/docs/react/guides/does-this-replace-client-state.md index 3d7ead4efd..f695f84127 100644 --- a/docs/react/guides/does-this-replace-client-state.md +++ b/docs/react/guides/does-this-replace-client-state.md @@ -1,18 +1,18 @@ --- id: does-this-replace-client-state -title: Does Tanstack Query replace Redux, MobX or other global state managers? +title: Does TanStack Query replace Redux, MobX or other global state managers? --- Well, let's start with a few important items: -- Tanstack Query is a **server-state** library, responsible for managing asynchronous operations between your server and client -- Redux, MobX, Zustand, etc. are **client-state** libraries that _can be used to store asynchronous data, albeit inefficiently when compared to a tool like Tanstack Query_ +- TanStack Query is a **server-state** library, responsible for managing asynchronous operations between your server and client +- Redux, MobX, Zustand, etc. are **client-state** libraries that _can be used to store asynchronous data, albeit inefficiently when compared to a tool like TanStack Query_ -With those points in mind, the short answer is that Tanstack Query **replaces the boilerplate code and related wiring used to manage cache data in your client-state and replaces it with just a few lines of code.** +With those points in mind, the short answer is that TanStack Query **replaces the boilerplate code and related wiring used to manage cache data in your client-state and replaces it with just a few lines of code.** -For a vast majority of applications, the truly **globally accessible client state** that is left over after migrating all of your async code to Tanstack Query is usually very tiny. +For a vast majority of applications, the truly **globally accessible client state** that is left over after migrating all of your async code to TanStack Query is usually very tiny. -> There are still some circumstances where an application might indeed have a massive amount of synchronous client-only state (like a visual designer or music production application), in which case, you will probably still want a client state manager. In this situation it's important to note that **Tanstack Query is not a replacement for local/client state management**. However, you can use Tanstack Query along side most client state managers with zero issues. +> There are still some circumstances where an application might indeed have a massive amount of synchronous client-only state (like a visual designer or music production application), in which case, you will probably still want a client state manager. In this situation it's important to note that **TanStack Query is not a replacement for local/client state management**. However, you can use TanStack Query along side most client state managers with zero issues. ## A Contrived Example @@ -29,7 +29,7 @@ const globalState = { } ``` -Currently, the global state manager is caching 4 types of server-state: `projects`, `teams`, `tasks`, and `users`. If we were to move these server-state assets to Tanstack Query, our remaining global state would look more like this: +Currently, the global state manager is caching 4 types of server-state: `projects`, `teams`, `tasks`, and `users`. If we were to move these server-state assets to TanStack Query, our remaining global state would look more like this: ```tsx const globalState = { @@ -51,6 +51,6 @@ With all of those things removed, you may ask yourself, **"Is it worth it to kee **And that's up to you!** -But Tanstack Query's role is clear. It removes asynchronous wiring and boilerplate from your application and replaces it with just a few lines of code. +But TanStack Query's role is clear. It removes asynchronous wiring and boilerplate from your application and replaces it with just a few lines of code. What are you waiting for, give it a go already! diff --git a/docs/react/guides/filters.md b/docs/react/guides/filters.md index 44c8e0997f..1b094442ad 100644 --- a/docs/react/guides/filters.md +++ b/docs/react/guides/filters.md @@ -3,7 +3,7 @@ id: filters title: Filters --- -Some methods within Tanstack Query accept a `QueryFilters` or `MutationFilters` object. +Some methods within TanStack Query accept a `QueryFilters` or `MutationFilters` object. ## `Query Filters` diff --git a/docs/react/guides/important-defaults.md b/docs/react/guides/important-defaults.md index 1721cb4563..6d12ba6f5b 100644 --- a/docs/react/guides/important-defaults.md +++ b/docs/react/guides/important-defaults.md @@ -3,7 +3,7 @@ id: important-defaults title: Important Defaults --- -Out of the box, Tanstack Query is configured with **aggressive but sane** defaults. **Sometimes these defaults can catch new users off guard or make learning/debugging difficult if they are unknown by the user.** Keep them in mind as you continue to learn and use Tanstack Query: +Out of the box, TanStack Query is configured with **aggressive but sane** defaults. **Sometimes these defaults can catch new users off guard or make learning/debugging difficult if they are unknown by the user.** Keep them in mind as you continue to learn and use TanStack Query: - Query instances via `useQuery` or `useInfiniteQuery` by default **consider cached data as stale**. @@ -15,7 +15,7 @@ Out of the box, Tanstack Query is configured with **aggressive but sane** defaul - The network is reconnected - The query is optionally configured with a refetch interval -If you see a refetch that you are not expecting, it is likely because you just focused the window and Tanstack Query is doing a [`refetchOnWindowFocus`](../guides/window-focus-refetching). During development, this will probably be triggered more frequently, especially because focusing between the Browser DevTools and your app will also cause a fetch, so be aware of that. +If you see a refetch that you are not expecting, it is likely because you just focused the window and TanStack Query is doing a [`refetchOnWindowFocus`](../guides/window-focus-refetching). During development, this will probably be triggered more frequently, especially because focusing between the Browser DevTools and your app will also cause a fetch, so be aware of that. > To change this functionality, you can use options like `refetchOnMount`, `refetchOnWindowFocus`, `refetchOnReconnect` and `refetchInterval`. diff --git a/docs/react/guides/infinite-queries.md b/docs/react/guides/infinite-queries.md index 8c55e9041f..8f0a032f82 100644 --- a/docs/react/guides/infinite-queries.md +++ b/docs/react/guides/infinite-queries.md @@ -3,7 +3,7 @@ id: infinite-queries title: Infinite Queries --- -Rendering lists that can additively "load more" data onto an existing set of data or "infinite scroll" is also a very common UI pattern. Tanstack Query supports a useful version of `useQuery` called `useInfiniteQuery` for querying these types of lists. +Rendering lists that can additively "load more" data onto an existing set of data or "infinite scroll" is also a very common UI pattern. TanStack Query supports a useful version of `useQuery` called `useInfiniteQuery` for querying these types of lists. When using `useInfiniteQuery`, you'll notice a few things are different: diff --git a/docs/react/guides/mutations.md b/docs/react/guides/mutations.md index 43f8c4bd5d..790396deb5 100644 --- a/docs/react/guides/mutations.md +++ b/docs/react/guides/mutations.md @@ -3,7 +3,7 @@ id: mutations title: Mutations --- -Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. For this purpose, Tanstack Query exports a `useMutation` hook. +Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects. For this purpose, TanStack Query exports a `useMutation` hook. Here's an example of a mutation that adds a new todo to the server: @@ -266,7 +266,7 @@ try { ## Retry -By default Tanstack Query will not retry a mutation on error, but it is possible with the `retry` option: +By default TanStack Query will not retry a mutation on error, but it is possible with the `retry` option: [//]: # 'Example9' diff --git a/docs/react/guides/network-mode.md b/docs/react/guides/network-mode.md index 6cef69383d..9180b5b6f0 100644 --- a/docs/react/guides/network-mode.md +++ b/docs/react/guides/network-mode.md @@ -3,9 +3,9 @@ id: network-mode title: Network Mode --- -Tanstack Query provides three different network modes to distinguish how [Queries](../guides/queries) and [Mutations](../guides/mutations) should behave if you have no network connection. This mode can be set for each Query / Mutation individually, or globally via the query / mutation defaults. +TanStack Query provides three different network modes to distinguish how [Queries](../guides/queries) and [Mutations](../guides/mutations) should behave if you have no network connection. This mode can be set for each Query / Mutation individually, or globally via the query / mutation defaults. -Since Tanstack Query is most often used for data fetching in combination with data fetching libraries, the default network mode is [online](#network-mode-online). +Since TanStack Query is most often used for data fetching in combination with data fetching libraries, the default network mode is [online](#network-mode-online). ## Network Mode: online @@ -19,11 +19,11 @@ The flags `isFetching` and `isPaused` are derived from this state and exposed fo > Keep in mind that it might not be enough to check for `loading` state to show a loading spinner. Queries can be in `state: 'loading'`, but `fetchStatus: 'paused'` if they are mounting for the first time, and you have no network connection. -If a query runs because you are online, but you go offline while the fetch is still happening, Tanstack Query will also pause the retry mechanism. Paused queries will then continue to run once you re-gain network connection. This is independent of `refetchOnReconnect` (which also defaults to `true` in this mode), because it is not a `refetch`, but rather a `continue`. If the query has been [cancelled](../guides/query-cancellation) in the meantime, it will not continue. +If a query runs because you are online, but you go offline while the fetch is still happening, TanStack Query will also pause the retry mechanism. Paused queries will then continue to run once you re-gain network connection. This is independent of `refetchOnReconnect` (which also defaults to `true` in this mode), because it is not a `refetch`, but rather a `continue`. If the query has been [cancelled](../guides/query-cancellation) in the meantime, it will not continue. ## Network Mode: always -In this mode, Tanstack Query will always fetch and ignore the online / offline state. This is likely the mode you want to choose if you use Tanstack Query in an environment where you don't need an active network connection for your Queries to work - e.g. if you just read from `AsyncStorage`, or if you just want to return `Promise.resolve(5)` from your `queryFn`. +In this mode, TanStack Query will always fetch and ignore the online / offline state. This is likely the mode you want to choose if you use TanStack Query in an environment where you don't need an active network connection for your Queries to work - e.g. if you just read from `AsyncStorage`, or if you just want to return `Promise.resolve(5)` from your `queryFn`. - Queries will never be `paused` because you have no network connection. - Retries will also not pause - your Query will go to `error` state if it fails. @@ -31,13 +31,13 @@ In this mode, Tanstack Query will always fetch and ignore the online / offline s ## Network Mode: offlineFirst -This mode is the middle ground between the first two options, where Tanstack Query will run the `queryFn` once, but then pause retries. This is very handy if you have a serviceWorker that intercepts a request for caching like in an [offline-first PWA](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers), or if you use HTTP caching via the [Cache-Control header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#the_cache-control_header). +This mode is the middle ground between the first two options, where TanStack Query will run the `queryFn` once, but then pause retries. This is very handy if you have a serviceWorker that intercepts a request for caching like in an [offline-first PWA](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Offline_Service_workers), or if you use HTTP caching via the [Cache-Control header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#the_cache-control_header). In those situations, the first fetch might succeed because it comes from an offline storage / cache. However, if there is a cache miss, the network request will go out and fail, in which case this mode behaves like an `online` query - pausing retries. ## Devtools -The [Tanstack Query Devtools](../devtools) will show Queries in a `paused` state if they would be fetching, but there is no network connection. There is also a toggle button to _Mock offline behavior_. Please note that this button will _not_ actually mess with your network connection (you can do that in the browser devtools), but it will set the [OnlineManager](../reference/onlineManager) in an offline state. +The [TanStack Query Devtools](../devtools) will show Queries in a `paused` state if they would be fetching, but there is no network connection. There is also a toggle button to _Mock offline behavior_. Please note that this button will _not_ actually mess with your network connection (you can do that in the browser devtools), but it will set the [OnlineManager](../reference/onlineManager) in an offline state. ## Signature diff --git a/docs/react/guides/paginated-queries.md b/docs/react/guides/paginated-queries.md index 45066af302..b1bbe85f4d 100644 --- a/docs/react/guides/paginated-queries.md +++ b/docs/react/guides/paginated-queries.md @@ -3,7 +3,7 @@ id: paginated-queries title: Paginated / Lagged Queries --- -Rendering paginated data is a very common UI pattern and in Tanstack Query, it "just works" by including the page information in the query key: +Rendering paginated data is a very common UI pattern and in TanStack Query, it "just works" by including the page information in the query key: [//]: # 'Example' ```tsx @@ -18,7 +18,7 @@ However, if you run this simple example, you might notice something strange: **The UI jumps in and out of the `success` and `loading` states because each new page is treated like a brand new query.** -This experience is not optimal and unfortunately is how many tools today insist on working. But not Tanstack Query! As you may have guessed, Tanstack Query comes with an awesome feature called `keepPreviousData` that allows us to get around this. +This experience is not optimal and unfortunately is how many tools today insist on working. But not TanStack Query! As you may have guessed, TanStack Query comes with an awesome feature called `keepPreviousData` that allows us to get around this. ## Better Paginated Queries with `keepPreviousData` diff --git a/docs/react/guides/parallel-queries.md b/docs/react/guides/parallel-queries.md index a54344c921..02c4abed87 100644 --- a/docs/react/guides/parallel-queries.md +++ b/docs/react/guides/parallel-queries.md @@ -7,7 +7,7 @@ title: Parallel Queries ## Manual Parallel Queries -When the number of parallel queries does not change, there is **no extra effort** to use parallel queries. Just use any number of Tanstack Query's `useQuery` and `useInfiniteQuery` hooks side-by-side! +When the number of parallel queries does not change, there is **no extra effort** to use parallel queries. Just use any number of TanStack Query's `useQuery` and `useInfiniteQuery` hooks side-by-side! [//]: # 'Example' @@ -30,7 +30,7 @@ function App () { ## Dynamic Parallel Queries with `useQueries` -If the number of queries you need to execute is changing from render to render, you cannot use manual querying since that would violate the rules of hooks. Instead, Tanstack Query provides a `useQueries` hook, which you can use to dynamically execute as many queries in parallel as you'd like. +If the number of queries you need to execute is changing from render to render, you cannot use manual querying since that would violate the rules of hooks. Instead, TanStack Query provides a `useQueries` hook, which you can use to dynamically execute as many queries in parallel as you'd like. `useQueries` accepts an **options object** with a **queries key** whose value is an **array of query objects**. It returns an **array of query results**: diff --git a/docs/react/guides/query-cancellation.md b/docs/react/guides/query-cancellation.md index 87504d2eed..e7cefdfb7c 100644 --- a/docs/react/guides/query-cancellation.md +++ b/docs/react/guides/query-cancellation.md @@ -3,7 +3,7 @@ id: query-cancellation title: Query Cancellation --- -Tanstack Query provides each query function with an [`AbortSignal` instance](https://developer.mozilla.org/docs/Web/API/AbortSignal), **if it's available in your runtime environment**. When a query becomes out-of-date or inactive, this `signal` will become aborted. This means that all queries are cancellable, and you can respond to the cancellation inside your query function if desired. The best part about this is that it allows you to continue to use normal async/await syntax while getting all the benefits of automatic cancellation. +TanStack Query provides each query function with an [`AbortSignal` instance](https://developer.mozilla.org/docs/Web/API/AbortSignal), **if it's available in your runtime environment**. When a query becomes out-of-date or inactive, this `signal` will become aborted. This means that all queries are cancellable, and you can respond to the cancellation inside your query function if desired. The best part about this is that it allows you to continue to use normal async/await syntax while getting all the benefits of automatic cancellation. The `AbortController` API is available in [most runtime environments](https://developer.mozilla.org/docs/Web/API/AbortController#browser_compatibility), but if the runtime environment does not support it then the query function will receive `undefined` in its place. You may choose to polyfill the `AbortController` API if you wish, there are [several available](https://www.npmjs.com/search?q=abortcontroller%20polyfill). @@ -80,9 +80,9 @@ const query = useQuery({ cancelToken: source.token, }) - // Cancel the request if Tanstack Query signals to abort + // Cancel the request if TanStack Query signals to abort signal?.addEventListener('abort', () => { - source.cancel('Query was cancelled by Tanstack Query') + source.cancel('Query was cancelled by TanStack Query') }) return promise @@ -159,7 +159,7 @@ const query = useQuery({ ## Manual Cancellation -You might want to cancel a query manually. For example, if the request takes a long time to finish, you can allow the user to click a cancel button to stop the request. To do this, you just need to call `queryClient.cancelQueries({ queryKey })`, which will cancel the query and revert it back to its previous state. If you have consumed the `signal` passed to the query function, Tanstack Query will additionally also cancel the Promise. +You might want to cancel a query manually. For example, if the request takes a long time to finish, you can allow the user to click a cancel button to stop the request. To do this, you just need to call `queryClient.cancelQueries({ queryKey })`, which will cancel the query and revert it back to its previous state. If you have consumed the `signal` passed to the query function, TanStack Query will additionally also cancel the Promise. [//]: # 'Example7' diff --git a/docs/react/guides/query-functions.md b/docs/react/guides/query-functions.md index 04e52a5c7e..73d9862dfb 100644 --- a/docs/react/guides/query-functions.md +++ b/docs/react/guides/query-functions.md @@ -29,7 +29,7 @@ useQuery({ ## Handling and Throwing Errors -For Tanstack Query to determine a query has errored, the query function **must throw** or return a **rejected Promise**. Any error that is thrown in the query function will be persisted on the `error` state of the query. +For TanStack Query to determine a query has errored, the query function **must throw** or return a **rejected Promise**. Any error that is thrown in the query function will be persisted on the `error` state of the query. [//]: # 'Example2' @@ -104,7 +104,7 @@ The `QueryFunctionContext` is the object passed to each query function. It consi - only for [Infinite Queries](../guides/infinite-queries) - the page parameter used to fetch the current page - `signal?: AbortSignal` - - [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) instance provided by Tanstack Query + - [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) instance provided by TanStack Query - Can be used for [Query Cancellation](../guides/query-cancellation) - `meta: Record | undefined` - an optional field you can fill with additional information about your query diff --git a/docs/react/guides/query-invalidation.md b/docs/react/guides/query-invalidation.md index 73b1c026cf..6fb7b79022 100644 --- a/docs/react/guides/query-invalidation.md +++ b/docs/react/guides/query-invalidation.md @@ -16,7 +16,7 @@ queryClient.invalidateQueries({ queryKey: ['todos'] }) [//]: # 'Example' -> Note: Where other libraries that use normalized caches would attempt to update local queries with the new data either imperatively or via schema inference, Tanstack Query gives you the tools to avoid the manual labor that comes with maintaining normalized caches and instead prescribes **targeted invalidation, background-refetching and ultimately atomic updates**. +> Note: Where other libraries that use normalized caches would attempt to update local queries with the new data either imperatively or via schema inference, TanStack Query gives you the tools to avoid the manual labor that comes with maintaining normalized caches and instead prescribes **targeted invalidation, background-refetching and ultimately atomic updates**. When a query is invalidated with `invalidateQueries`, two things happen: diff --git a/docs/react/guides/query-keys.md b/docs/react/guides/query-keys.md index 4c75ce3abc..78e52d076e 100644 --- a/docs/react/guides/query-keys.md +++ b/docs/react/guides/query-keys.md @@ -3,7 +3,7 @@ id: query-keys title: Query Keys --- -At its core, Tanstack Query manages query caching for you based on query keys. Query keys have to be an Array at the top level, and can be as simple as an Array with a single string, or as complex as an array of many strings and nested objects. As long as the query key is serializable, and **unique to the query's data**, you can use it! +At its core, TanStack Query manages query caching for you based on query keys. Query keys have to be an Array at the top level, and can be as simple as an Array with a single string, or as complex as an array of many strings and nested objects. As long as the query key is serializable, and **unique to the query's data**, you can use it! ## Simple Query Keys diff --git a/docs/react/guides/query-retries.md b/docs/react/guides/query-retries.md index 87876579b8..e955eeb628 100644 --- a/docs/react/guides/query-retries.md +++ b/docs/react/guides/query-retries.md @@ -3,7 +3,7 @@ id: query-retries title: Query Retries --- -When a `useQuery` query fails (the query function throws an error), Tanstack Query will automatically retry the query if that query's request has not reached the max number of consecutive retries (defaults to `3`) or a function is provided to determine if a retry is allowed. +When a `useQuery` query fails (the query function throws an error), TanStack Query will automatically retry the query if that query's request has not reached the max number of consecutive retries (defaults to `3`) or a function is provided to determine if a retry is allowed. You can configure retries both on a global level and an individual query level. @@ -29,7 +29,7 @@ const result = useQuery({ ## Retry Delay -By default, retries in Tanstack Query do not happen immediately after a request fails. As is standard, a back-off delay is gradually applied to each retry attempt. +By default, retries in TanStack Query do not happen immediately after a request fails. As is standard, a back-off delay is gradually applied to each retry attempt. The default `retryDelay` is set to double (starting at `1000`ms) with each attempt, but not exceed 30 seconds: diff --git a/docs/react/guides/scroll-restoration.md b/docs/react/guides/scroll-restoration.md index 288688d233..6b8d0267bd 100644 --- a/docs/react/guides/scroll-restoration.md +++ b/docs/react/guides/scroll-restoration.md @@ -3,6 +3,6 @@ id: scroll-restoration title: Scroll Restoration --- -Traditionally, when you navigate to a previously visited page on a web browser, you would find that the page would be scrolled to the exact position where you were before you navigated away from that page. This is called **scroll restoration** and has been in a bit of a regression since web applications have started moving towards client side data fetching. With Tanstack Query however, that's no longer the case. +Traditionally, when you navigate to a previously visited page on a web browser, you would find that the page would be scrolled to the exact position where you were before you navigated away from that page. This is called **scroll restoration** and has been in a bit of a regression since web applications have started moving towards client side data fetching. With TanStack Query however, that's no longer the case. -Out of the box, "scroll restoration" for all queries (including paginated and infinite queries) Just Works™️ in Tanstack Query. The reason for this is that query results are cached and able to be retrieved synchronously when a query is rendered. As long as your queries are being cached long enough (the default time is 5 minutes) and have not been garbage collected, scroll restoration will work out of the box all the time. +Out of the box, "scroll restoration" for all queries (including paginated and infinite queries) Just Works™️ in TanStack Query. The reason for this is that query results are cached and able to be retrieved synchronously when a query is rendered. As long as your queries are being cached long enough (the default time is 5 minutes) and have not been garbage collected, scroll restoration will work out of the box all the time. diff --git a/docs/react/guides/window-focus-refetching.md b/docs/react/guides/window-focus-refetching.md index 0e6da62941..fb59ce999b 100644 --- a/docs/react/guides/window-focus-refetching.md +++ b/docs/react/guides/window-focus-refetching.md @@ -3,7 +3,7 @@ id: window-focus-refetching title: Window Focus Refetching --- -If a user leaves your application and returns to stale data, **Tanstack Query automatically requests fresh data for you in the background**. You can disable this globally or per-query using the `refetchOnWindowFocus` option: +If a user leaves your application and returns to stale data, **TanStack Query automatically requests fresh data for you in the background**. You can disable this globally or per-query using the `refetchOnWindowFocus` option: #### Disabling Globally @@ -42,7 +42,7 @@ useQuery({ ## Custom Window Focus Event -In rare circumstances, you may want to manage your own window focus events that trigger Tanstack Query to revalidate. To do this, Tanstack Query provides a `focusManager.setEventListener` function that supplies you the callback that should be fired when the window is focused and allows you to set up your own events. When calling `focusManager.setEventListener`, the previously set handler is removed (which in most cases will be the default handler) and your new handler is used instead. For example, this is the default handler: +In rare circumstances, you may want to manage your own window focus events that trigger TanStack Query to revalidate. To do this, TanStack Query provides a `focusManager.setEventListener` function that supplies you the callback that should be fired when the window is focused and allows you to set up your own events. When calling `focusManager.setEventListener`, the previously set handler is removed (which in most cases will be the default handler) and your new handler is used instead. For example, this is the default handler: [//]: # 'Example3' diff --git a/docs/react/reference/QueryCache.md b/docs/react/reference/QueryCache.md index 6237681232..f3f0e7dd39 100644 --- a/docs/react/reference/QueryCache.md +++ b/docs/react/reference/QueryCache.md @@ -3,7 +3,7 @@ id: QueryCache title: QueryCache --- -The `QueryCache` is the storage mechanism for Tanstack Query. It stores all the data, meta information and state of queries it contains. +The `QueryCache` is the storage mechanism for TanStack Query. It stores all the data, meta information and state of queries it contains. **Normally, you will not interact with the QueryCache directly and instead use the `QueryClient` for a specific cache.** diff --git a/docs/react/reference/QueryClient.md b/docs/react/reference/QueryClient.md index d60dad9b8c..fb7a6c8ec4 100644 --- a/docs/react/reference/QueryClient.md +++ b/docs/react/reference/QueryClient.md @@ -437,7 +437,7 @@ if (queryClient.isFetching()) { } ``` -Tanstack Query also exports a handy [`useIsFetching`](../reference/useIsFetching) hook that will let you subscribe to this state in your components without creating a manual subscription to the query cache. +TanStack Query also exports a handy [`useIsFetching`](../reference/useIsFetching) hook that will let you subscribe to this state in your components without creating a manual subscription to the query cache. **Options** @@ -457,7 +457,7 @@ if (queryClient.isMutating()) { } ``` -Tanstack Query also exports a handy [`useIsMutating`](../reference/useIsMutating) hook that will let you subscribe to this state in your components without creating a manual subscription to the mutation cache. +TanStack Query also exports a handy [`useIsMutating`](../reference/useIsMutating) hook that will let you subscribe to this state in your components without creating a manual subscription to the mutation cache. **Options** diff --git a/docs/react/reference/focusManager.md b/docs/react/reference/focusManager.md index 4777e77bb2..de9482abd2 100644 --- a/docs/react/reference/focusManager.md +++ b/docs/react/reference/focusManager.md @@ -3,7 +3,7 @@ id: FocusManager title: FocusManager --- -The `FocusManager` manages the focus state within Tanstack Query. +The `FocusManager` manages the focus state within TanStack Query. It can be used to change the default event listeners or to manually change the focus state. diff --git a/docs/react/reference/onlineManager.md b/docs/react/reference/onlineManager.md index f077244f4f..4b6536e9e0 100644 --- a/docs/react/reference/onlineManager.md +++ b/docs/react/reference/onlineManager.md @@ -3,7 +3,7 @@ id: OnlineManager title: OnlineManager --- -The `OnlineManager` manages the online state within Tanstack Query. +The `OnlineManager` manages the online state within TanStack Query. It can be used to change the default event listeners or to manually change the online state. diff --git a/examples/react/basic-graphql-request/index.html b/examples/react/basic-graphql-request/index.html index 27bdf766ca..984f90ddcb 100644 --- a/examples/react/basic-graphql-request/index.html +++ b/examples/react/basic-graphql-request/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Basic GraphQl Request Example App + TanStack Query React Basic GraphQl Request Example App diff --git a/examples/react/basic-typescript/index.html b/examples/react/basic-typescript/index.html index 6d9f50bd62..f20222fbd3 100644 --- a/examples/react/basic-typescript/index.html +++ b/examples/react/basic-typescript/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Basic TypeScript Example App + TanStack Query React Basic TypeScript Example App diff --git a/examples/react/basic/index.html b/examples/react/basic/index.html index fb8b862df9..f75be5068f 100644 --- a/examples/react/basic/index.html +++ b/examples/react/basic/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Basic Example App + TanStack Query React Basic Example App diff --git a/examples/react/default-query-function/index.html b/examples/react/default-query-function/index.html index 21911ae946..61693932eb 100644 --- a/examples/react/default-query-function/index.html +++ b/examples/react/default-query-function/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Default Query Function Example App + TanStack Query React Default Query Function Example App diff --git a/examples/react/offline/index.html b/examples/react/offline/index.html index 9a0f82f68b..69e3e23d0f 100644 --- a/examples/react/offline/index.html +++ b/examples/react/offline/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Offline Example App + TanStack Query React Offline Example App diff --git a/examples/react/playground/index.html b/examples/react/playground/index.html index 18fec2fda7..99cca4c3fa 100644 --- a/examples/react/playground/index.html +++ b/examples/react/playground/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Playgorund Example App + TanStack Query React Playgorund Example App diff --git a/examples/react/react-router/index.html b/examples/react/react-router/index.html index e4634dceaf..4e93947879 100644 --- a/examples/react/react-router/index.html +++ b/examples/react/react-router/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Router Example App + TanStack Query React Router Example App diff --git a/examples/react/rick-morty/index.html b/examples/react/rick-morty/index.html index 747e5b4c5a..4ab314f7dd 100644 --- a/examples/react/rick-morty/index.html +++ b/examples/react/rick-morty/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Rick And Morty Example App + TanStack Query React Rick And Morty Example App diff --git a/examples/react/simple/index.html b/examples/react/simple/index.html index 31f2cb2baf..bede960426 100644 --- a/examples/react/simple/index.html +++ b/examples/react/simple/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Simple Example App + TanStack Query React Simple Example App diff --git a/examples/react/star-wars/index.html b/examples/react/star-wars/index.html index acd8b85651..3f9d49f06e 100644 --- a/examples/react/star-wars/index.html +++ b/examples/react/star-wars/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Star Wars Example App + TanStack Query React Star Wars Example App diff --git a/examples/react/suspense/index.html b/examples/react/suspense/index.html index e7dd9fdce2..57df3f9dd5 100644 --- a/examples/react/suspense/index.html +++ b/examples/react/suspense/index.html @@ -6,7 +6,7 @@ - Tanstack Query React Suspense Example App + TanStack Query React Suspense Example App