前端bubuCuo redux-Saga系列
redux-saga简介
使用 dispatch 往 store 发送 action 的这个过程是可以被拦截的, 自然而然地就可以在这里增加各种中间件Middleware。redux-saga是redux的中间件,主要负责从action派发到更新store中间具有副作用行为的处理。
// 监听类型为increment_saga的action,监听到启动increment
yield takeEvery('increment_saga', increment)
}
function* rootSaga() {
// 启动watchIncrement