SAP Spartacus Loader Meta Reducer学习笔记 - loaderReducer
鏈接:https://sap.github.io/spartacus-docs/loader-meta-reducer/#creating-actions
To give better feedback to users, based on their actions, we often have to keep information such as “cart is loading”, “fetching user address failed”, and so on.
為了給用戶提供更好的用戶體驗,基于其在Spartacus上進行的動作,我們需要track諸如“Cart正在加載”,“讀取用戶地址信息失敗”等信息。
For every separate application state, we have to keep that meta data beside. Separate for cart, user information, product data and so on. Implementing this logic in all of these places manually would result in having different solutions to the same problem across the codebase.
That’s why in spartacus loaderReducer was created.
例子:
leader.reducer.ts:
高階reducer:
注意loader reducer和entity reducer的繼承關系:
更多Jerry的原創文章,盡在:“汪子熙”:
總結
以上是生活随笔為你收集整理的SAP Spartacus Loader Meta Reducer学习笔记 - loaderReducer的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 缩量跌停后第二天走势怎么走?
- 下一篇: 动物森友会amiibo卡有什么用?动森a