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也存儲在內(nèi):
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開發(fā)者工具里觀察到的數(shù)據(jù):
更多Jerry的原創(chuàng)文章,盡在:“汪子熙”:
總結(jié)
以上是生活随笔為你收集整理的SAP Spartacus的持久化存储学习笔记的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 森林通关剧情图文流程 森林通关攻略 森林
- 下一篇: SAP Spartacus index.