我有一个传奇,会向商店发送SIGNIN
动作。
const { status, userDetails: {token} } = yield take(SIGNIN);
yield put({ type:SIGNIN, payload: {status, token} });
在reducer
内,我可以记录payload
,其中包含status and token
的属性和值,
authenticated: createReducer(userAuthenticated, {
[SIGNIN](state, action) {
console.log(action.payload);
}
})
但是当我尝试通过payload object
访问console.log(action.payload.status)
内的属性时,我得到了Uncaught (in promise) TypeError: Cannot read property 'status' of undefined
。我们是不是想在reducer中访问有效负载对象的属性?