Typescript ngrx存储突然没有加载状态属性及其缩减器(Angular Cli)
在一些琐碎的应用程序更改之后,我的ngrx存储突然无法正常加载。正如您在下面的屏幕截图中所看到的,我正在获取我的大多数存储属性,这些属性甚至通过它们的还原程序加载我的api结果,但是我缺少一个临界状态属性Typescript ngrx存储突然没有加载状态属性及其缩减器(Angular Cli),typescript,angular-cli,ngrx,Typescript,Angular Cli,Ngrx,在一些琐碎的应用程序更改之后,我的ngrx存储突然无法正常加载。正如您在下面的屏幕截图中所看到的,我正在获取我的大多数存储属性,这些属性甚至通过它们的还原程序加载我的api结果,但是我缺少一个临界状态属性uiState 我已经撤消了琐碎的更改,重新启动了浏览器、终端,清除了缓存和本地存储,重新启动了计算机,但我的uiState没有添加到我的存储中,它的reducer也从未调用过。这可能是因为Cli或网页包内存问题吗?如果是,我怎样才能清除记忆 这就是我所在州的样子: export interf
uiState
我已经撤消了琐碎的更改,重新启动了浏览器、终端,清除了缓存和本地存储,重新启动了计算机,但我的uiState
没有添加到我的存储中,它的reducer也从未调用过。这可能是因为Cli或网页包内存问题吗?如果是,我怎样才能清除记忆
这就是我所在州的样子:
export interface AppState {
uiState: UIState;
foodStaging: $DietEntryMap;
recipeBuilder: RecipeBuilder;
dbData: MongoData;
}
下面是我如何组成减缩器:
const reducers = {
uiState: uiStateReducer,
recipeBuilder: recipeReducer,
foodStaging: stagingReducer,
dbData: dbDataReducer
};
const developmentReducer: ActionReducer<AppState> =
compose(
storeFreeze,
storeLogger(loggerOptions),
localStorageSync(['dbData'], true),
combineReducers)
(reducers);
const productionReducer: ActionReducer<AppState> =
compose(localStorageSync(['dbData']), combineReducers)(reducers);
export function storeReducer(state: AppState, action: any) {
if (environment.production) return productionReducer(state, action);
else return developmentReducer(state, action);
}
INITIAL\u UI\u STATE
有效当我试图通过桶将助手函数从reducer文件导入到Effect服务时出现了一些问题。我只是把整个功能移到了效果上,一切都正常了
export function uiStateReducer(state: UIState = INITIAL_UI_STATE, action: UiActions): UIState {
switch (action.type) {
// action handlers
}
}