Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 NgRx 获取 devtools 的状态以将其发送到服务器并能够将其导入其他地方而无需使用 Chrome 或 Firefox 插件,也就是说,我需要像插件一样导出 JSON 但以编程方式,有谁知道我怎么能做到这一点?非常感谢!
我以编程方式需要的 devtools 部分。
答案如下:注入StoreDevTools如下:
constructor (_store: Store <State>, _devtools: StoreDevtools)
然后得到这样的历史:
_devtools.liftedState.subscribe (...)
使用订阅中生成的结果,您可以将其导入插件中,以便根据需要进行调试。
问候!