我正在尝试使用 @ngrx/store 在我的应用程序中实现撤消/重做功能。
这里描述了基本概念(Redux):https://redux.js.org/recipes/implementing-undo-history
在配方中的某个时刻,reducer 函数被包装在 Redux 中所谓的 reducer 增强器
A reducer enhancer (or a higher order reducer) is a function that takes a reducer, and returns a new reducer that is able to handle new actions, or to hold more state, delegating control to the inner reducer for the actions it doesn't understand.
NgRx 中与此等效的是什么?我如何构建商店...
store.pipe(select('counter'));
...但是将其包装在“增强器”函数中?伪代码:
undoable(store.pipe(select('counter'));
有人向我指出了元 reducer ( https://ngrx.io/guide/store/metareducers ),但是相关文档并没有为我解决问题。
最佳答案
关于angular - NgRx 中的 reducer 增强器相当于什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54889699/