繁体   English   中英

NgRx StoreModule.forRoot - 在没有根级减速器时指定元减速器

[英]NgRx StoreModule.forRoot - specify metareducers when there is no root level reducer

我的项目没有根减速器,它只有功能状态。

我在这个问题中看到我们可以使用: StoreModule.forRoot({}) 这很好,但我还需要指定元减速器。 我试过了: StoreModule.forRoot({}, { metaReducers })但它似乎不起作用。

有谁知道如何使这项工作?

提前致谢!

问题中描述的方式是正确的,您需要在当前模块或其任何父模块中导入存储。

StoreModule.forRoot({}, {
  metaReducers,
});

如果您收到错误 - 它属于其他东西,但不属于StoreModule.forRoot

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM