ngrx-undo | an undo library for ngrx/store | State Container library
kandi X-RAY | ngrx-undo Summary
kandi X-RAY | ngrx-undo Summary
an undo library for ngrx/store
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ngrx-undo
ngrx-undo Key Features
ngrx-undo Examples and Code Snippets
Community Discussions
Trending Discussions on ngrx-undo
QUESTION
I have an Angular4 application using ngrx. I created a undo higher-order reducer as documented on the redux website.
Unfortunately I am having issues with Ahead of Time (AoT) compilation when I apply this function in my root.reducers.ts file, and get this error
ERROR in Error encountered resolving symbol values statically. Calling function 'undoable', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol rootReducer
The code works perfectly when AoT is turned off or after a file is modified, in which case just in time compilation is used.
I tried using ngrx-undo previously, but it didn't seem to work, which is why I rolled my own solution.
I've tried looking at other stackoverflow posts and searching google, but the majority of the other issues seem to be with 3rd party libraries or custom components, which aren't relevant in this case.
I know that I can fix the issue by removing the higher order reducer and converting cartReducer to be undoable directly, but that isn't desirable since we would have a lot of code duplication if we make any of the other reducers undoable.
How can I resolve this error? Preferably without removing AoT compilation, since that will be needed once we hit production.
Code: root.reducers.ts ...ANSWER
Answered 2017-Sep-16 at 00:34In the end I abstracted out most of the undo reducer code into separate functions, and returned a function that built a specific reducer. This seemed to fix the issue
in cart.reducer.ts
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ngrx-undo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page