Redux 传奇路由器。如何在每场比赛中 运行 特定路线传奇?
Redux saga router. How to run specific route saga on every match?
假设我有这样的路线:
const routes = {
'/:tab': switchTabGenerator,
'/users/:id': anotherGenerator
}
现在,如果我导航到 /users/:id
,将不会调用路由 /:tab
。但我需要这个来改变选定的标签模型。
我该怎么做?
takeLatestAPI提供的redux-saga
可以采取一系列的动作来监听。
takeLatest([action.route1, action.route2, action.route3], switchTabGenerator),
传递要触发 saga 的所有路由操作。
假设我有这样的路线:
const routes = {
'/:tab': switchTabGenerator,
'/users/:id': anotherGenerator
}
现在,如果我导航到 /users/:id
,将不会调用路由 /:tab
。但我需要这个来改变选定的标签模型。
我该怎么做?
takeLatestAPI提供的redux-saga
可以采取一系列的动作来监听。
takeLatest([action.route1, action.route2, action.route3], switchTabGenerator),
传递要触发 saga 的所有路由操作。