Skip to content

Commit ee9aa05

Browse files
committed
💄
1 parent 8d71046 commit ee9aa05

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

‎packages/query/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ function Profile() {
1515
if (error) return 'Unknown error';
1616
return `Hello ${response?.email}`;
1717
}
18+
```
1819

1920
## Lazy Queries
2021

2122
To enable a query at a later time (for example if the query depends on a previous query),
2223
the method can be set to `null` which will effectively defer the query until the query
2324
method is defined.
2425

26+
```tsx
2527
function ToDos() {
2628
const [filter, setFilter] = useState(false);
2729
const { response } = useQuery('/todos', { method: filter ? 'GET' : null });

‎packages/query/src/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
* if (error) return 'Unknown error';
1717
* return `Hello ${response?.email}`;
1818
* }
19+
* ```
1920
*
2021
* ## Lazy Queries
2122
*
2223
* To enable a query at a later time (for example if the query depends on a previous query),
2324
* the method can be set to `null` which will effectively defer the query until the query
2425
* method is defined.
2526
*
27+
* ```tsx
2628
* function ToDos() {
2729
* const [filter, setFilter] = useState(false);
2830
* const { response } = useQuery('/todos', { method: filter ? 'GET' : null });

0 commit comments

Comments
 (0)