@dr.pogodin/react-global-state 0.19.2 → 0.19.4
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/build/cjs/index.js.map +1 -1
- package/build/cjs/useAsyncCollection.js +55 -39
- package/build/cjs/useAsyncCollection.js.map +1 -1
- package/build/cjs/useAsyncData.js +35 -22
- package/build/cjs/useAsyncData.js.map +1 -1
- package/build/code/GlobalStateProvider.js +5 -7
- package/build/code/GlobalStateProvider.js.map +1 -1
- package/build/code/index.js.map +1 -1
- package/build/code/useAsyncCollection.js +57 -57
- package/build/code/useAsyncCollection.js.map +1 -1
- package/build/code/useAsyncData.js +47 -33
- package/build/code/useAsyncData.js.map +1 -1
- package/build/code/utils.js +1 -2
- package/build/code/utils.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/useAsyncCollection.d.ts +1 -1
- package/build/types/useAsyncData.d.ts +2 -1
- package/package.json +22 -22
- package/tstyche.config.json +4 -4
|
@@ -8,7 +8,7 @@ export type AsyncCollectionLoaderT<DataT, IdT extends number | string = number |
|
|
|
8
8
|
isAborted: () => boolean;
|
|
9
9
|
oldDataTimestamp: number;
|
|
10
10
|
setAbortCallback: (cb: () => void) => void;
|
|
11
|
-
}) =>
|
|
11
|
+
}) => DataT | null | Promise<DataT | null>;
|
|
12
12
|
export type AsyncCollectionReloaderT<DataT, IdT extends number | string = number | string> = (loader?: AsyncCollectionLoaderT<DataT, IdT>) => void | Promise<void>;
|
|
13
13
|
type CollectionItemT<DataT> = {
|
|
14
14
|
data: DataT | null;
|
|
@@ -9,7 +9,7 @@ export type AsyncDataLoaderT<DataT> = (oldData: null | DataT, meta: {
|
|
|
9
9
|
isAborted: () => boolean;
|
|
10
10
|
oldDataTimestamp: number;
|
|
11
11
|
setAbortCallback: (cb: () => void) => void;
|
|
12
|
-
}) =>
|
|
12
|
+
}) => DataT | null | Promise<DataT | null>;
|
|
13
13
|
export type AsyncDataReloaderT<DataT> = (loader?: AsyncDataLoaderT<DataT>) => void | Promise<void>;
|
|
14
14
|
export type AsyncDataEnvelopeT<DataT> = {
|
|
15
15
|
data: null | DataT;
|
|
@@ -34,6 +34,7 @@ export type UseAsyncDataResT<DataT> = {
|
|
|
34
34
|
data: DataT | null;
|
|
35
35
|
loading: boolean;
|
|
36
36
|
reload: AsyncDataReloaderT<DataT>;
|
|
37
|
+
set: (data: DataT | null) => void;
|
|
37
38
|
timestamp: number;
|
|
38
39
|
};
|
|
39
40
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dr.pogodin/react-global-state",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.4",
|
|
4
4
|
"description": "Hook-based global state for React",
|
|
5
5
|
"main": "./build/code/index.js",
|
|
6
6
|
"types": "./build/types/index.d.ts",
|
|
@@ -40,39 +40,39 @@
|
|
|
40
40
|
"node": ">=18"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@babel/runtime": "^7.
|
|
44
|
-
"@dr.pogodin/js-utils": "^0.
|
|
45
|
-
"@types/lodash": "^4.17.
|
|
43
|
+
"@babel/runtime": "^7.28.2",
|
|
44
|
+
"@dr.pogodin/js-utils": "^0.1.3",
|
|
45
|
+
"@types/lodash": "^4.17.20",
|
|
46
46
|
"lodash": "^4.17.21",
|
|
47
47
|
"uuid": "^11.1.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@babel/cli": "^7.
|
|
51
|
-
"@babel/core": "^7.
|
|
52
|
-
"@babel/node": "^7.
|
|
53
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
54
|
-
"@babel/preset-env": "^7.
|
|
50
|
+
"@babel/cli": "^7.28.0",
|
|
51
|
+
"@babel/core": "^7.28.0",
|
|
52
|
+
"@babel/node": "^7.28.0",
|
|
53
|
+
"@babel/plugin-transform-runtime": "^7.28.0",
|
|
54
|
+
"@babel/preset-env": "^7.28.0",
|
|
55
55
|
"@babel/preset-react": "^7.27.1",
|
|
56
56
|
"@babel/preset-typescript": "^7.27.1",
|
|
57
|
-
"@dr.pogodin/eslint-configs": "^0.0.
|
|
58
|
-
"@testing-library/dom": "^10.4.
|
|
57
|
+
"@dr.pogodin/eslint-configs": "^0.0.11",
|
|
58
|
+
"@testing-library/dom": "^10.4.1",
|
|
59
59
|
"@testing-library/react": "^16.3.0",
|
|
60
|
-
"@tsconfig/recommended": "^1.0.
|
|
61
|
-
"@types/jest": "^
|
|
60
|
+
"@tsconfig/recommended": "^1.0.10",
|
|
61
|
+
"@types/jest": "^30.0.0",
|
|
62
62
|
"@types/pretty": "^2.0.3",
|
|
63
|
-
"@types/react": "^19.1.
|
|
64
|
-
"@types/react-dom": "^19.1.
|
|
65
|
-
"babel-jest": "^
|
|
63
|
+
"@types/react": "^19.1.9",
|
|
64
|
+
"@types/react-dom": "^19.1.7",
|
|
65
|
+
"babel-jest": "^30.0.5",
|
|
66
66
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
67
|
-
"jest": "^
|
|
68
|
-
"jest-environment-jsdom": "^
|
|
67
|
+
"jest": "^30.0.5",
|
|
68
|
+
"jest-environment-jsdom": "^30.0.5",
|
|
69
69
|
"mockdate": "^3.0.5",
|
|
70
70
|
"rimraf": "^6.0.1",
|
|
71
|
-
"tstyche": "^3.
|
|
72
|
-
"typescript": "^5.
|
|
71
|
+
"tstyche": "^4.3.0",
|
|
72
|
+
"typescript": "^5.9.2"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"react": "^19.1.
|
|
76
|
-
"react-dom": "^19.1.
|
|
75
|
+
"react": "^19.1.1",
|
|
76
|
+
"react-dom": "^19.1.1"
|
|
77
77
|
}
|
|
78
78
|
}
|
package/tstyche.config.json
CHANGED