ngrx存储是否持久化? [英] Is the ngrx store persistent?

查看:72
本文介绍了ngrx存储是否持久化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ngrx存储是否持久化?换句话说,我们可以关闭浏览器,然后重新打开它,并检索添加到 ngrx存储库的状态吗?

Is the ngrx store persistent? In other words can we close the browser reopen it, and retrieve state that was added to the ngrx store?

推荐答案

当前ngrx/store不支持此类功能.但是您可以使用 ngrx-store-persist 这样的库来维护状态数据发送到浏览器indexedDB,localStorage或WebStorage.该库自动保存和恢复ngrx/store的数据.您只需要添加要存储在配置中的redux键(请参阅用法"部分).

Currently ngrx/store doesn't support such functionality. But you can maintain state by using a library like ngrx-store-persist to save data to the browsers indexedDB, localStorage or WebStorage. This library automatically saves and restores ngrx/store's data. You just need to add redux keys that you want to store in the config (see "Usage" section).

这篇关于ngrx存储是否持久化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆