Skip to content

Commit

Permalink
docs: correct spelling mistakes (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
raoufswe authored Jul 8, 2020
1 parent da29536 commit ce92bc2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/src/pages/docs/guides/default-query-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ 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 to identify what it should fetch, you can do that by providing a **default query function** to React 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 React Query:

```js
// Define a default query function that will recieve the query key
// Define a default query function that will receive the query key
const defaultQueryFn = async key => {
const { data } = await axios.get(`https://jsonplaceholder.typicode.com${key}`)
return data
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/guides/paginated-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Rendering paginated data is a very common UI pattern to avoid overloading bandwi

Consider the following example where we would ideally want to increment a pageIndex (or cursor) for a query. If we were to use `useQuery`, it would technically work fine, but the UI would jump in and out of the `success` and `loading` states as different queries are created and destroyed for each page or cursor. By using `usePaginatedQuery` we get a few new things:

- Instead of `data`, you should use `resolvedData` instead. This is the data from the last known successful query result. As new page queries resolve, `resolvedData` remains available to show the last page's data while a new page is requested. When the new page data is received, `resolvedData` get's updated to the new page's data.
- Instead of `data`, you should use `resolvedData` instead. This is the data from the last known successful query result. As new page queries resolve, `resolvedData` remains available to show the last page's data while a new page is requested. When the new page data is received, `resolvedData` gets updated to the new page's data.
- If you specifically need the data for the exact page being requested, `latestData` is available. When the desired page is being requested, `latestData` will be `undefined` until the query resolves, then it will get updated with the latest pages data result.

```js
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ If you're not using a module bundler or package manager we also have a global ("
<script src="https://unpkg.com/react-query/dist/react-query.production.min.js"></script>
```

Once you've added this you will have access to the `window.ReactQuery` object and it's exports.
Once you've added this you will have access to the `window.ReactQuery` object and its exports.

> This installation/usage requires the [React CDN script bundles](https://reactjs.org/docs/cdn-links.html) to be on the page as well.
2 changes: 1 addition & 1 deletion docs/src/pages/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Simply put, React Query makes **fetching, caching, synchronizing and updating se

## Motivation

Out of the box, React applications **do not** come with an opinionated way of fetching or updating data from your components so developers end up building their own ways of fetching data. This usually means cobbling together component-based state and effecs using React hooks, or using more general purpose state management libraries to store and provide asynchronous data throughout their apps.
Out of the box, React applications **do not** come with an opinionated way of fetching or updating data from your components so developers end up building their own ways of fetching data. This usually means cobbling together component-based state and effect using React hooks, or using more general purpose state management libraries to store and provide asynchronous data throughout their apps.

While most traditional state management libraries are great for working with client state, they are **not so great at working with async or server state**. This is because **server state is totally different**. For starters, server state:

Expand Down
2 changes: 1 addition & 1 deletion examples/default-query-function/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ReactDOM from "react-dom";
import axios from "axios";
import { useQuery, queryCache, ReactQueryConfigProvider } from "react-query";

// Define a default query function that will recieve the query key
// Define a default query function that will receive the query key
const defaultQueryFn = async (key) => {
const { data } = await axios.get(
`https://jsonplaceholder.typicode.com${key}`
Expand Down

1 comment on commit ce92bc2

@vercel
Copy link

@vercel vercel bot commented on ce92bc2 Jul 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.