根據 在組件中dispatch一個action的例子中,若是要在effects中對於param數據和當前的state數據進行再出處理,這裏怎麼獲取state呢?採用select,以下:異步
-
-
-
-
-
-
-
-
-
-
*addByONe({ param}, { call, put,select }) {
-
-
const num = yield select(state => state.num)
-
-
-
-
-
-
param1 = num + param; 這裏就能夠使用num進行操做了
-
-
-
-
-
-
-
-
-
-
-
-
-
-
return { ...state, ...action.num };
-
-
-
-