我在redux-saga中放置了带有有效负载的动作,该动作是有效的,但无法获取有效负载
动作:
export const takeKey = createAction("TAKE_KEY_REQUEST", data => {
//when it come from redux-saga,it does't console
console.log("data",data)
return data;
});
redux-saga
//in this function,I put action
function* loginAsync(action) {
yield put({type:"TAKE_KEY_REQUEST",payload:{test:"test"}})
}
//this get type:"TAKE_KEY_REQUEST"
function* takeKeyAsync(action) {
//console
//from page:action,{type:"TAKE_KEY_REQUEST",payload:{}}
//from saga:action,{type: "TAKE_KEY_REQUEST", @@redux-saga/SAGA_ACTION: true}
console.log("action",action)
}