@raf-query/react 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +7 -6
- package/dist/use-query.d.mts +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.19](https://github.com/KATT/raf-query/compare/0.0.18...0.0.19) (2026-10-12)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **core:** type the cache's promises as Thenable ([#21](https://github.com/KATT/raf-query/issues/21)) ([c0541b0](https://github.com/KATT/raf-query/commit/c0541b0c14e687f25d47f25fe457e49b135d8c06))
|
|
8
|
+
|
|
3
9
|
## [0.0.18](https://github.com/KATT/raf-query/compare/0.0.17...0.0.18) (2026-10-12)
|
|
4
10
|
|
|
5
11
|
### Bug Fixes
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
- **core:** allow undefined query data ([#22](https://github.com/KATT/raf-query/issues/22)) ([9b85e57](https://github.com/KATT/raf-query/commit/9b85e57bf2fed4413cdbc1b49f925cc60dad695f)), references [#20](https://github.com/KATT/raf-query/issues/20)
|
|
8
14
|
|
|
9
15
|
## [0.0.17](https://github.com/KATT/raf-query/compare/0.0.16...0.0.17) (2026-10-12)
|
|
10
16
|
|
package/README.md
CHANGED
|
@@ -574,16 +574,17 @@ In the browser, retries pause while `navigator.onLine` is `false`: after the ret
|
|
|
574
574
|
| `CancelledError` | Rejection of a request cancelled by `clear()` or a restart |
|
|
575
575
|
| `QueryHandle<TFactory>` | Handle type for props |
|
|
576
576
|
| `EnsuredQueryHandle<TFactory>` | Handle type for props fed by `ensure` |
|
|
577
|
+
| `Thenable<T>` | Promise with `status` / `value` / `reason`, read by `use()` |
|
|
577
578
|
| `DataOf<TFactory>`, `InputOf<TFactory>` | A factory's data and input types |
|
|
578
579
|
|
|
579
580
|
`@raf-query/react` (plus all of the above):
|
|
580
581
|
|
|
581
|
-
| Export | Use
|
|
582
|
-
| ------------------------------------- |
|
|
583
|
-
| `QueryClientProvider` | Provides a client to the tree
|
|
584
|
-
| `useQueryClient()` | Read the client
|
|
585
|
-
| `useQuery(factory, handle, options?)` | `[
|
|
586
|
-
| `useWaterfall(factory, input)` | Start a query during render and return its handle
|
|
582
|
+
| Export | Use |
|
|
583
|
+
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
584
|
+
| `QueryClientProvider` | Provides a client to the tree |
|
|
585
|
+
| `useQueryClient()` | Read the client |
|
|
586
|
+
| `useQuery(factory, handle, options?)` | `[Thenable<Data>, controls]`; for paged factories `Data` is `{ pages, pageParams }` and controls include paging |
|
|
587
|
+
| `useWaterfall(factory, input)` | Start a query during render and return its handle |
|
|
587
588
|
|
|
588
589
|
## Development
|
|
589
590
|
|
package/dist/use-query.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataOf, EnsuredQueryHandle, InputOf, IsPaged, QueryClient, QueryFactory, QueryHandle, QueryKey, QueryObserverOptions } from "@raf-query/core";
|
|
1
|
+
import { DataOf, EnsuredQueryHandle, InputOf, IsPaged, QueryClient, QueryFactory, QueryHandle, QueryKey, QueryObserverOptions, Thenable } from "@raf-query/core";
|
|
2
2
|
//#region src/use-query.d.ts
|
|
3
3
|
/** `refetchInterval`, `refetchOnWindowFocus`, `refetchOnReconnect`, `whilePending`. */
|
|
4
4
|
export type UseQueryOptions = QueryObserverOptions;
|
|
@@ -35,7 +35,7 @@ export interface PagingControls {
|
|
|
35
35
|
readonly isFetchingPreviousPage: boolean;
|
|
36
36
|
}
|
|
37
37
|
export type UseQueryControls<TFactory extends QueryFactory> = IsPaged<TFactory> extends true ? QueryControls<TFactory> & PagingControls : QueryControls<TFactory>;
|
|
38
|
-
export type UseQueryResult<TFactory extends QueryFactory> = readonly [promise:
|
|
38
|
+
export type UseQueryResult<TFactory extends QueryFactory> = readonly [promise: Thenable<DataOf<TFactory>>, controls: UseQueryControls<TFactory>];
|
|
39
39
|
/** {@link useQuery}'s result for a handle from `ensure`. */
|
|
40
40
|
export type UseEnsuredQueryResult<TFactory extends QueryFactory> = readonly [data: DataOf<TFactory>, controls: UseQueryControls<TFactory>];
|
|
41
41
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raf-query/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "React bindings for raf-query, a render-as-you-fetch query library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"query",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"./tanstack-router": "./dist/tanstack-router.mjs"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@raf-query/core": "0.0.
|
|
43
|
+
"@raf-query/core": "0.0.19",
|
|
44
44
|
"effect": "^4.0.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|