@t8/react-pending 1.0.31 → 1.0.33

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 +7 -7
  2. package/package.json +6 -5
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # T8 React Pending
2
2
 
3
- A concise async action state management lib for React apps
3
+ Self-contained async action state management for React apps
4
4
 
5
- [![npm](https://img.shields.io/npm/v/@t8/react-pending?labelColor=345&color=46e)](https://www.npmjs.com/package/@t8/react-pending) ![Lightweight](https://img.shields.io/bundlephobia/minzip/@t8/react-pending?label=minzip&labelColor=345&color=46e) ![CSR ✓](https://img.shields.io/badge/CSR-✓-345?labelColor=345) ![SSR ✓](https://img.shields.io/badge/SSR-✓-345?labelColor=345)
5
+ [![npm](https://img.shields.io/npm/v/@t8/react-pending?labelColor=345&color=46e)](https://www.npmjs.com/package/@t8/react-pending) ![Lightweight](https://img.shields.io/bundlephobia/minzip/@t8/react-pending?label=minzip&labelColor=345&color=46e)
6
6
 
7
- **Why?** To manage the async action state, whether local or shared, without tightly coupling it with the app state. Decoupled pending state as described here acts like a lightweight scaffolding on top of the action's and component's successful scenario. It's easy to set up from scratch without rewriting the async actions and affecting the app state, and easy to manage further on since it's barely intertwined with other app's internals.
7
+ **Features:** Decoupled from app state management and async actions' internals · Local or shared async action state · CSR/SSR-compatible
8
8
 
9
9
  <!-- docsgen-show-start --
10
10
  ```diff
@@ -60,11 +60,11 @@ In our setup, there are two components rendering their content with regard to th
60
60
  export let Status = () => {
61
61
  + let [state] = usePendingState("fetch-items");
62
62
 
63
- if (!state.initialized) return "";
64
- if (!state.complete) return "Busy";
65
- if (state.error) return "Error";
63
+ if (!state.initialized) return null;
64
+ if (!state.complete) return <>Busy</>;
65
+ if (state.error) return <>Error</>;
66
66
 
67
- return "OK";
67
+ return <>OK</>;
68
68
  };
69
69
  ```
70
70
 
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@t8/react-pending",
3
- "version": "1.0.31",
4
- "description": "A concise async action state management lib for React apps",
3
+ "version": "1.0.33",
4
+ "description": "Self-contained async action state management for React apps",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
8
8
  "type": "module",
9
9
  "scripts": {
10
- "demo": "npx @t8/serve 3000 * tests/async_status -b src/index.tsx",
10
+ "demo": "npx @t8/serve tests/async_status --spa -b src/index.tsx",
11
11
  "preversion": "npx npm-run-all shape test",
12
12
  "shape": "npx codeshape",
13
13
  "test": "npx playwright test --project=chromium"
@@ -22,6 +22,7 @@
22
22
  "keywords": [
23
23
  "async actions",
24
24
  "pending state",
25
+ "async state",
25
26
  "react"
26
27
  ],
27
28
  "peerDependencies": {
@@ -29,13 +30,13 @@
29
30
  },
30
31
  "devDependencies": {
31
32
  "@playwright/test": "^1.56.0",
32
- "@t8/serve": "^0.1.39",
33
+ "@t8/serve": "^0.2.0",
33
34
  "@types/node": "^24.10.2",
34
35
  "@types/react": "^19.2.7",
35
36
  "@types/react-dom": "^19.2.3",
36
37
  "react-dom": "^19.2.3"
37
38
  },
38
39
  "dependencies": {
39
- "@t8/react-store": "^1.2.7"
40
+ "@t8/react-store": "^1.2.8"
40
41
  }
41
42
  }