@robohall/react-query-factory 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/README.md +9 -7
  2. 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
- TanStack Query is very good at caching. It is less good at deciding what your query keys should be, or at fetching every page of a cursor-paginated endpoint before your component has to think about it.
3
+ [![npm](https://img.shields.io/npm/v/@robohall/react-query-factory)](https://www.npmjs.com/package/@robohall/react-query-factory)
4
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/@robohall/react-query-factory)](https://bundlephobia.com/package/@robohall/react-query-factory)
5
+ [![license](https://img.shields.io/npm/l/@robohall/react-query-factory)](./LICENSE)
4
6
 
5
- This library wraps query definitions in a small factory function that handles composable key namespacing, automatic multi-page crawling, and `useInfiniteQuery` generation so the part of your codebase that knows *what* to fetch stays separate from the part that knows *how React renders it*.
7
+ A tiny wrapper around TanStack Query that turns a query definition into a reusable factory: consistent cache keys by default, automatic pagination crawling, and `useInfiniteQuery` support with no extra setup.
6
8
 
7
- It has zero runtime dependencies — all TanStack Query imports are type-only and erased at compile time.
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 five interactive demos using a mock paginated API: basic single-page fetch, full crawl, factory composition, infinite query with per-page crawling, and a target-search that stops the crawl early.
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.0",
3
+ "version": "1.0.1",
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",