easy-soft-dva 3.6.4 → 3.6.6
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/es/index.js +1 -1
- package/es/utils/definition.d.ts +4 -0
- package/es/utils/dvaAssist.d.ts +13 -11
- package/es/utils/packagePrompt.d.ts +4 -0
- package/package.json +3 -3
- package/es/utils/meta.d.ts +0 -4
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t}from"./regeneratorRuntime.js";import{
|
|
1
|
+
import{_ as t}from"./regeneratorRuntime.js";import{checkStringIsNullOrWhiteSpace as e,displayTextMessage as a,isNumber as o,logWarn as r,toNumber as n,logExecute as c,logError as i,isUndefined as s,isString as l,setCache as u,logDebug as d}from"easy-soft-utility";import{create as f}from"./dva-core/index.js";export{Provider,connect}from"./dva-core/index.js";import{createLoading as m}from"./dva-loading/index.js";import"invariant";import"react-redux";import"redux";import"redux-saga";import"is-plain-object";import"flatten";import"@reduxjs/toolkit";import"warning";var p="easy-soft-dva";function v(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"".concat(p,"::").concat(t,"::").concat(e(a)?"":a)}var h="stateAssist";function g(){if(!C.defaultCodeSetComplete&&!C.defaultCodePromptSetInformationComplete){var t="".concat(v(h),"logData -> logger display switch default is false, if want to display log, please set it before first log, use setLoggerDisplaySwitch to set it, this message only show once.");a({text:t,color:"#08BBEE",dataDescription:"hint",ancillaryInformation:""});try{throw new Error("please set use setStateDefaultCode")}catch(t){console.error(t)}C.defaultCodePromptSetInformationComplete=!0}return C.defaultCode}var C={defaultCodePromptSetInformationComplete:!1,defaultCodeSetComplete:!1,defaultCode:200};function y(t){o(t)||r("".concat(v(h),"setStateDefaultCode -> code must be number")),C.defaultCode=n(t)}var S,x,D,w;function b(t){return c(v("dvaAssist","createApp")),(S=f(t)).use(m({})),w||t.models.forEach((function(t){return S.model(t)})),w=!0,S.start(),x=S._store,S.getStore=function(){return x},S.use({onError:function(t){i(t)}}),D=x.dispatch,S.dispatch=D,S}var j={reducerData:"reducerData"};function k(e,a,o){var r=t(t({},{callback:null,pretreatment:null,alias:null,cacheData:!1}),a),n=r.payload,c=r.alias,i=r.cacheData,f=null;if(s(c)||!l(c)?f=t(t({},e),{},{data:n,fromRemote:!0}):(f=t(t({},e),{},{fromRemote:!0}))[c]=n,i){var m="".concat(o,"_").concat(c||"data"),p=u({key:m,value:n});d("modal ".concat(o," cache data, key is ").concat(o,"_").concat(c||"data",", ").concat(p?"cache success":"cache fail","."))}return f}var E={reducerData:function(t,e,a){return k(t,e,a)}};function I(t){return b({initialState:{},models:t}).getStore()}function P(){return{data:{code:g(),message:"success",dataSuccess:!0,data:{},list:[],extra:{}}}}var _={cacheData:!1},A={callback:null,pretreatment:null};function R(){return S.dispatch}export{b as createApp,g as getDefaultCode,R as getDispatchWrapper,I as getStore,P as getTacitlyState,A as handleDefaultParams,E as reducerCollection,k as reducerDataAssist,_ as reducerDefaultParams,j as reducerNameCollection,y as setStateDefaultCode,C as stateConfigure};
|
package/es/utils/dvaAssist.d.ts
CHANGED
|
@@ -8,6 +8,19 @@ export function createApp(opt: any): {
|
|
|
8
8
|
};
|
|
9
9
|
export function reducerDataAssist(state: any, action: any, namespace: any): any;
|
|
10
10
|
export function getStore(models: any): any;
|
|
11
|
+
/**
|
|
12
|
+
* get tacitly state, it is for state initialization.
|
|
13
|
+
*/
|
|
14
|
+
export function getTacitlyState(): {
|
|
15
|
+
data: {
|
|
16
|
+
code: number;
|
|
17
|
+
message: string;
|
|
18
|
+
dataSuccess: boolean;
|
|
19
|
+
data: {};
|
|
20
|
+
list: never[];
|
|
21
|
+
extra: {};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
11
24
|
export function getDispatchWrapper(): any;
|
|
12
25
|
export namespace reducerNameCollection {
|
|
13
26
|
const reducerData: string;
|
|
@@ -15,17 +28,6 @@ export namespace reducerNameCollection {
|
|
|
15
28
|
export namespace reducerCollection {
|
|
16
29
|
function reducerData(state: any, action: any, namespace: any): any;
|
|
17
30
|
}
|
|
18
|
-
export namespace tacitlyState {
|
|
19
|
-
namespace data {
|
|
20
|
-
export const code: number;
|
|
21
|
-
export const message: string;
|
|
22
|
-
export const dataSuccess: boolean;
|
|
23
|
-
const data_1: {};
|
|
24
|
-
export { data_1 as data };
|
|
25
|
-
export const list: never[];
|
|
26
|
-
export const extra: {};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
31
|
export namespace reducerDefaultParams {
|
|
30
32
|
const cacheData: boolean;
|
|
31
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-soft-dva",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.6",
|
|
4
4
|
"description": "The core lightweight library for dva, based on redux and redux-saga.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/runtime": "^7.20.7",
|
|
36
36
|
"@reduxjs/toolkit": "^1.9.1",
|
|
37
|
-
"easy-soft-utility": "^2.3.
|
|
37
|
+
"easy-soft-utility": "^2.3.4",
|
|
38
38
|
"flatten": "^1.0.3",
|
|
39
39
|
"global": "^4.4.0",
|
|
40
40
|
"invariant": "^2.2.4",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"redux": "4.x"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "6972c41c3f9ab2ccf80e3ecde3062478570ccbc3"
|
|
95
95
|
}
|
package/es/utils/meta.d.ts
DELETED