nilsmehlhorn / ngrx-wieder

Lightweight undo-redo for Angular with NgRx & immer.js
https://nils-mehlhorn.de/posts/angular-undo-redo-ngrx-redux
MIT License
127 stars 10 forks source link

History to contain only the changes made to the state #51

Closed KyDenZ closed 3 years ago

KyDenZ commented 3 years ago

I have a project with a lot of data in my store, and it is too expensive to make a complete copy for each action.

Can we think of a history that only contains changes made to the store? Without having a copy for each action?

I would be interested to work on this project

nilsmehlhorn commented 3 years ago

Are you already using ngrx-wieder? The library isn't storing a complete copy of the state, it's only storing JSON patches which describe the performed changes. Checkout this post where I explain different approaches for implementing undo-redo (including the one used in ngrx-wieder): https://nils-mehlhorn.de/posts/angular-undo-redo-ngrx-redux

KyDenZ commented 3 years ago

The problem was that I recreated a new reference by destructuring the object.

I did it myself because when I use produceOn I have a type problem : Cannot assign type 'void' to type 'WritableDraft'

Sorry for the inconvenience