Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does it also work with immutable data-structures?


I haven't tested it yet, but it should. The magic behind redux-undo is a reducer enhancer (higher order reducer) - it returns a function that processes undo/redo and then (if appropriate) calls your reducer. If your reducer uses immutable data-structures, redux-undo will simply store your data (immutable or not) in the history.

redux-undo itself doesn't use immutable data structures, though (for dependency reasons). However, I do make sure not to change any data directly. (you know, the usual redux reducer guidelines)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: