本文介绍了Store冻结和ngrx8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到ngrx/store版本8。我注意到ng更新删除了StoreFreeze的所有出现。也会将其从metaReducer中删除。

所以我的问题是--为什么

将store Freeze与ngrx 8一起使用有问题吗?

ngrx8之前:

import { ActionReducerMap, MetaReducer } from '@ngrx/store';
import { storeFreeze } from 'ngrx-store-freeze';
import * as fromGroupMember from './group-member.reducer';
import * as fromDirectoryForm from './directory-filter-form.reducer';

export const metaReducers: MetaReducer<IState>[] =
(localStorage && localStorage.getItem('production') === 'false') ? [storeFreeze] : [];

之后:

import { ActionReducerMap, MetaReducer } from '@ngrx/store';

import * as fromGroupMember from './group-member.reducer';
import * as fromDirectoryForm from './directory-filter-form.reducer';

export const metaReducers: MetaReducer<IState>[] =
(localStorage && localStorage.getItem('production') === 'false') ? [] : [];

推荐答案

8.0.0-rc.1上添加了迁移,以删除ngrx-store-freeze的用法,具体如下:

请参阅github issue

这篇关于Store冻结和ngrx8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 21:29