@robohall/react-query-factory 1.0.0 → 1.0.2
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/README.md +9 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
# react-query-factory
|
|
1
|
+
# @robohall/react-query-factory
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@robohall/react-query-factory)
|
|
4
|
+
[](https://bundlephobia.com/package/@robohall/react-query-factory)
|
|
5
|
+
[](./LICENSE)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
A factory function for TanStack Query configs. Instead of calling `useQuery` with ad-hoc options, you define a factory once and call it anywhere — getting consistent cache keys, automatic pagination crawling, and `useInfiniteQuery` support for free. TanStack's API stays fully exposed.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
Zero runtime dependencies — all TanStack imports are type-only and erased at compile time.
|
|
8
10
|
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
## Installation
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
|
-
npm install react-query-factory
|
|
16
|
+
npm install @robohall/react-query-factory
|
|
15
17
|
# peer dependency: @tanstack/react-query >= 5.0.0
|
|
16
18
|
```
|
|
17
19
|
|
|
@@ -27,7 +29,7 @@ import {
|
|
|
27
29
|
DescribeInstancesCommand,
|
|
28
30
|
type DescribeInstancesCommandInput,
|
|
29
31
|
} from '@aws-sdk/client-ec2';
|
|
30
|
-
import { queryFactory } from 'react-query-factory';
|
|
32
|
+
import { queryFactory } from '@robohall/react-query-factory';
|
|
31
33
|
import { useQuery } from '@tanstack/react-query';
|
|
32
34
|
|
|
33
35
|
const ec2 = new EC2Client({ region: 'us-east-1' });
|
|
@@ -223,7 +225,7 @@ Return type of `factory.infinite(params)`. Pass directly to `useInfiniteQuery()`
|
|
|
223
225
|
|
|
224
226
|
## Running the sandbox
|
|
225
227
|
|
|
226
|
-
The sandbox contains
|
|
228
|
+
The sandbox contains six interactive demos using a mock paginated API: basic single-page fetch, full crawl, factory composition, infinite query with per-page crawling, early-stop target search, and namespace-based cache invalidation.
|
|
227
229
|
|
|
228
230
|
```bash
|
|
229
231
|
npm run sandbox
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robohall/react-query-factory",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A factory abstraction for TanStack Query (React Query) with composable keys, crawling support, and automatic infinite query generation",
|
|
5
5
|
"author": "Robert Hall",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/roberth26/react-query-factory.git"
|
|
9
|
+
"url": "git+https://github.com/roberth26/react-query-factory.git"
|
|
10
10
|
},
|
|
11
11
|
"bugs": "https://github.com/roberth26/react-query-factory/issues",
|
|
12
12
|
"homepage": "https://github.com/roberth26/react-query-factory#readme",
|