@t8/react-pending 1.0.31 → 1.0.32
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 +4 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -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
|
|
65
|
-
if (state.error) return
|
|
63
|
+
if (!state.initialized) return null;
|
|
64
|
+
if (!state.complete) return <>Busy</>;
|
|
65
|
+
if (state.error) return <>Error</>;
|
|
66
66
|
|
|
67
|
-
return
|
|
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.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"description": "A concise async action state management lib 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
|
|
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"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@playwright/test": "^1.56.0",
|
|
32
|
-
"@t8/serve": "^0.
|
|
32
|
+
"@t8/serve": "^0.2.0",
|
|
33
33
|
"@types/node": "^24.10.2",
|
|
34
34
|
"@types/react": "^19.2.7",
|
|
35
35
|
"@types/react-dom": "^19.2.3",
|