subscriptions: {
setup({ dispatch, history }) {
history.listen(location => {
if (location.pathname !== '/user') return
dispatch({
type: 'asyncUser', // effects
payload: location.query
})
})
},
},
subscriptions: {
setup({ dispatch, history }) {
history.listen(location => {
dispatch({
type: 'updateActiveIndex', // reducers
payload: location.pathname
})
})
},
},
subscriptions: {
setup({ dispatch, history }) {
history.listen(location => {
if (location.pathname !== '/resource') return
// 多个 dispatch effects
dispatch({ type: 'asyncProducts' })
dispatch({ type: 'asyncList' })
})
},
},
}