ez-saga 17.0.2 → 17.0.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/package.json +1 -1
- package/src/redux/createApp.ts +11 -4
- /package/src/{index.ts → index.js} +0 -0
package/package.json
CHANGED
package/src/redux/createApp.ts
CHANGED
|
@@ -47,10 +47,14 @@ export interface ModelEffect {
|
|
|
47
47
|
|
|
48
48
|
export interface ReduxModel {
|
|
49
49
|
name: string,
|
|
50
|
-
state
|
|
50
|
+
state?: any;
|
|
51
|
+
reducers?: ModelReducer
|
|
52
|
+
effects?: ModelEffect;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface ReduxSagaModel extends ReduxModel {
|
|
51
56
|
initialState: any,
|
|
52
57
|
reducers: ModelReducer
|
|
53
|
-
effects: ModelEffect;
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
export interface RegistedModel {
|
|
@@ -118,11 +122,14 @@ function getRegistModelFunc(store: Store<any, ReduxAction>, registedModel: Regis
|
|
|
118
122
|
* effects: {}
|
|
119
123
|
* }
|
|
120
124
|
*/
|
|
121
|
-
return function regist(
|
|
125
|
+
return function regist(reduxModel: ReduxModel): void {
|
|
126
|
+
const model = {
|
|
127
|
+
...reduxModel,
|
|
128
|
+
initialState: {}
|
|
129
|
+
} as ReduxSagaModel;
|
|
122
130
|
if (registedModel[model.name]) {
|
|
123
131
|
return;
|
|
124
132
|
}
|
|
125
|
-
delete model.initialState;
|
|
126
133
|
if (!model.state) {
|
|
127
134
|
model.state = {};
|
|
128
135
|
}
|
|
File without changes
|