@cclr/react-model 0.1.25 → 0.1.26
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/lib/cjs/index.js +0 -6
- package/lib/esm/index.js +0 -1
- package/lib/type/index.d.ts +2 -15
- package/package.json +7 -7
package/lib/cjs/index.js
CHANGED
|
@@ -202,9 +202,3 @@ exports.useObjStore = useObjStore;
|
|
|
202
202
|
exports.useSimpleSet = useSimpleSet;
|
|
203
203
|
exports.useSimpleStore = useSimpleStore;
|
|
204
204
|
exports.useSimpleValue = useSimpleValue;
|
|
205
|
-
Object.keys(model).forEach(function (k) {
|
|
206
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
207
|
-
enumerable: true,
|
|
208
|
-
get: function () { return model[k]; }
|
|
209
|
-
});
|
|
210
|
-
});
|
package/lib/esm/index.js
CHANGED
package/lib/type/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ModelsSingleApi, ModelType, TGetStateType, TGetActionsType, ModelsType, ModelsApi, TActionMapApi, TSubscribesFun } from '@cclr/model';
|
|
3
|
-
export * from '@cclr/model';
|
|
1
|
+
import { ModelsSingleApi, ModelType, TGetStateType, TGetActionsType, ModelsType, TActionMapApi, TSubscribesFun } from '@cclr/model';
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* 对于对象类型的模型,获取对象的状态和操作
|
|
@@ -33,17 +31,6 @@ declare const useSimpleValue: <T extends ModelsSingleApi<ModelType>>(model: T) =
|
|
|
33
31
|
*/
|
|
34
32
|
declare const useSimpleSet: <T extends ModelsSingleApi<ModelType>>(model: T) => TGetActionsType<T>["setValue"];
|
|
35
33
|
|
|
36
|
-
/**
|
|
37
|
-
* 获取指定模型的状态和操作
|
|
38
|
-
* @param modelName
|
|
39
|
-
* @param model
|
|
40
|
-
* @returns
|
|
41
|
-
*/
|
|
42
|
-
declare const useStore: <MT extends ModelsType>(modelName: keyof MT, model: ModelsApi<MT>) => (MT[keyof MT]["state"] | _cclr_model.TActionMapApi<MT[keyof MT]["actions"], MT[keyof MT]["state"]>)[];
|
|
43
|
-
|
|
44
|
-
type TReactModelApi = {
|
|
45
|
-
useStore: typeof useStore;
|
|
46
|
-
};
|
|
47
34
|
/**
|
|
48
35
|
* 获取model的api
|
|
49
36
|
*/
|
|
@@ -62,4 +49,4 @@ type TReactModelsApi<MS extends ModelsType> = {
|
|
|
62
49
|
|
|
63
50
|
declare const ReactModel: <MT extends ModelsType>(models: MT) => TReactModelsApi<MT>;
|
|
64
51
|
|
|
65
|
-
export { ReactModel,
|
|
52
|
+
export { ReactModel, useObjStore, useSimpleSet, useSimpleStore, useSimpleValue };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cclr/react-model",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"description": "前端开发状态管理",
|
|
5
5
|
"author": "cclr <18843152354@163.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"test": "vitest",
|
|
25
25
|
"relese": "npm run test && npm publish",
|
|
26
|
-
"build": "
|
|
26
|
+
"build": "ccf build",
|
|
27
27
|
"g:test": "vitest run",
|
|
28
|
-
"g:build": "
|
|
28
|
+
"g:build": "ccf build"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "a643554f19e182f0735f9e3206c64dc497cd3d73",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cclr/lang": "0.1.
|
|
33
|
-
"@cclr/model": "0.1.
|
|
34
|
-
"@cclr/utils": "0.1.
|
|
32
|
+
"@cclr/lang": "0.1.26",
|
|
33
|
+
"@cclr/model": "0.1.26",
|
|
34
|
+
"@cclr/utils": "0.1.26",
|
|
35
35
|
"immer": "^10.1.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|