SAP Spartacus的持久化存储学习笔记
https://sap.github.io/spartacus-docs/configurable-state-persistence-and-rehydration/
Spartacus offers a mechanism to sync NGRX’s store slices to the specified browser’s storage - localStorage or sessionStorage.
ngrx的存储slice暂时同步到浏览器的storage里去:localStorage或者SessionStorage.
例子:购物车id:
access token也存储在内:
access_token_stored_at
In case there is a need to sync multiple slices of the state, just specify the required properties in storageSync’s keys config and specify the storage type.
需要同步多个state slice的情况如何做?
default-state-config.ts里定义的spartcacus-local-data, 也就是Chrome开发者工具里观察到的数据:
更多Jerry的原创文章,尽在:“汪子熙”:
post SAP-Garson
原文链接:https://blog.csdn.net/i042416/article/details/113120133文章来自于网络,如果侵犯了您的权益,请联系站长删除!