Comments (5)
You need to put any actions that can be undone/redone into allowedActionTypes
. You can then also put some of them into mergeActionTypes
in order to undo/redo them in whole when actions of a single type occur directly after each other. A good example for this are sliders, have a look at the example in the readme.
Either way, all actions for undo/redo need to be in allowedActionTypes
. Leaving it empty will make all actions undoable/redoable. Hope this is clear, otherwise don't hesitate to ask again.
I would be nice if you could give this library a star when it's working for you :)
EDIT: Ah, I see your error now. I'll look into it.
EDIT2: When I corrected your StackBlitz to use only allowedActionTypes
the error was next is undefined
& state is undefined
. And that was exactly the case for your setup: you didn't provide an initial state. Here's a fixed StackBlitz: https://stackblitz.com/edit/angular-fitmtz
from ngrx-wieder.
Can you provide more information or a reproduction on https://stackblitz.com/ or similar?
How are you integrating the library and what exactly is not working properly? Which versions of Angular, NgRx and ngrx-wieder are you using?
from ngrx-wieder.
Here is the stackblitz example https://stackblitz.com/edit/angular-xqf5h9. Doing in the stackblitz worked, because i copied exactly like in your example. Maybe i was not seeing the error, but I noticed that you must use "mergeActionTypes" to work and not "allowedActionTypes", maybe i undestand wrong the documentation because english it's not my first language.
from ngrx-wieder.
Ok, that was exactly the problem, i wasn't passing the initial state to the reducer. And passing the initial state i was able to use the allowedActionTypes
. Thanks for this library, worked perfectly in my project that uses OpenLayers, i was able to undo and redo the zoom and the center of the map
from ngrx-wieder.
Great to here that it worked out! I'll soon update the library to be in line with the new ngrx functions like createReducer
. Some things changed with the new NgRx version and I'll have to see how to deal with that.
Sounds like a cool use-case, your welcome to share a link once it's public. This way people can see some examples of the library in action.
from ngrx-wieder.
Related Issues (20)
- Implementing with lazy-loaded feature modules HOT 2
- unable to import produceOn HOT 4
- AOT error from Angular 'ngrx-wieder' contains deep imports into
- installation of 4.0.2 failed HOT 1
- Feature request: actions for enable/disable undo & redo HOT 2
- Error with ngrx 11 HOT 1
- Error when trying to use canUndo canRedo buttons HOT 6
- Using createUndoRedoReducer with StoreModule.forFeature doesn't work HOT 9
- 6.0.2 version dependency on Angular 11 HOT 3
- Can't install version 3.1.x with angular 9.1.x and npm 7.x HOT 5
- History to contain only the changes made to the state HOT 2
- angular 13 support HOT 2
- History not filling HOT 4
- is there a version of this lib for Angular 14 HOT 9
- Angular 15 Support HOT 7
- Import default "produce" breaks jest tests HOT 6
- [Immer] An immer producer returned a new value *and* modified its draft HOT 5
- support for angular v16, @ngrx/store v16 HOT 5
- Ngrx V17 Support HOT 6
- CRUD operations support HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngrx-wieder.