【发布时间】:2017-01-12 09:26:01
【问题描述】:
我正在使用带有ngrx/store 的Angular 2。我想在用户发送 USER_LOGOUT 时重置整个商店状态。
我阅读了 Dan Abramov 对 How to reset the state of a Redux store? 的回答,但我不知道如何正确编写 rootReducer 以及在使用 ngrx/store 时将其放在何处。
或者在ngrx/store中有没有其他方法可以处理这个问题?
bootstrap(App, [
provideStore(
compose(
storeFreeze,
storeLogger(),
combineReducers
)({
router: routerReducer,
foo: fooReducer,
bar: barReducer
})
)
]);
【问题讨论】:
标签: angular typescript ngrx