Skip to content
This repository was archived by the owner on Oct 19, 2019. It is now read-only.

Commit 14629cf

Browse files
committed
fix: fix onModel error
1 parent 00e0f4d commit 14629cf

1 file changed

Lines changed: 2 additions & 18 deletions

File tree

src/index.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,7 @@ export default function loading(
3030
},
3131
epicStart(state, action) {
3232
const epicCounterKey = `${action.epic}Counter`;
33-
let epicCounter = 0;
34-
35-
if (!state.epics[action.model]) {
36-
let initEpics = {};
37-
action.epics.forEach(item => {
38-
initEpics[`${item}Counter`] = 0;
39-
initEpics[item] = false;
40-
});
41-
return {
42-
...state,
43-
epics: {
44-
...state.epics,
45-
[action.model]: initEpics,
46-
}
47-
};
48-
}
49-
50-
epicCounter = state.epics[action.model][epicCounterKey] + action.loading;
33+
let epicCounter = state.epics[action.model][epicCounterKey] + action.loading;
5134
return {
5235
...state,
5336
epics: {
@@ -77,6 +60,7 @@ export default function loading(
7760
},
7861
};
7962
this.model(_model);
63+
this.stream('loading').subscribe();
8064

8165
// hooks
8266
// 初始化 model 状态

0 commit comments

Comments
 (0)