如何解决没有Redux devtools扩展,带有NgRx的Angular应用无法正常工作
如果我禁用了redux devtools,则在单击页面内的任何位置之前,应用页面无法正确呈现。它在我的控制台上没有显示任何错误。
我的商店模块是
imports: [
StoreModule.forRoot(reducers,{ metaReducers }),EffectsModule.forRoot(effects),StoreDevtoolsModule.instrument({ maxAge: 25 }),// !environment.production && remote flag (dev) & authenticated ? StoreDevtoolsModule.instrument({ maxAge: 25 }) : [],StoreRouterConnectingModule.forRoot({
serializer: CustomSerializer,}),]
解决方法
将选项strictActionWithinNgZone设置为true(默认为false)。并检查在商店更新期间是否会出错。 看起来您是在区域外调度动作。
strictActionWithinNgZone
The strictActionWithinNgZone check verifies that Actions are dispatched by asynchronous tasks running within NgZone. Actions dispatched by tasks,running outside of NgZone,will not trigger ChangeDetection upon completion and may result in a stale view.
检查版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。