index页面:
reducer:
reSelect:
saga:
问题:执行完“return state.set(‘currentUser’, action.getUser);”就可以触发componentWillReceiveProps
但是执行完“return state.set(‘currentFactoryUser’, action.getFactoryUser);”之后,没有任何反应。为什么?
index页面:
reducer:
reSelect:
saga:
问题:执行完“return state.set(‘currentUser’, action.getUser);”就可以触发componentWillReceiveProps
但是执行完“return state.set(‘currentFactoryUser’, action.getFactoryUser);”之后,没有任何反应。为什么?
应该是你的saga写的有问题吧。
takeLatest(ActionTypes.AFTER_SUCCESS_LOGIN, afterSuccessLogin)
确定AFTER_SUCCESS_LOGIN 这个对吗???
这是actionTypes
export const START_LOGIN = ‘START_LOGIN’;
export const SUCCESS_LOGIN = ‘SUCCESS_LOGIN’;//对应currentUser
export const SUCCESS_LOGIN_FACTORYUSER = ‘SUCCESS_LOGIN_FACTORYUSER’;//对应currentFactoryUser
export const AFTER_SUCCESS_LOGIN = ‘AFTER_SUCCESS_LOGIN’;
export const EXIT_LOGIN = ‘EXIT_LOGIN’;
确定ActionTypes.AFTER_SUCCESS_LOGIN 这个状态有dispatch吗?
也就是说你的afterSuccessLogin 这个 generator 执行了吗?