charkour / zundo

🍜 undo/redo middleware for zustand. <700 bytes
https://codesandbox.io/s/zundo-2dom9
MIT License
616 stars 20 forks source link

Add demo for using slices #176

Open charkour opened 5 months ago

charkour commented 5 months ago

https://github.com/pmndrs/zustand/blob/main/docs/guides/slices-pattern.md

MNeverOff commented 4 months ago

Wanted to quickly pass by and say thanks for this amazing middleware, very well done and it's about the best documented one out there.

Having the slices usage documented, especially with TS, would be invaluable as it can be a bit difficult to wrap one's head around getting that going, as well as combining with other middlewares. Albeit, the current wrap example is helpful as it hints at how it can be done and is already with TS.

charkour commented 4 months ago

Thanks for the kind words! If you manage to get the slices pattern working with zundo, please feel free to make a PR. Eventually I'll find some time to add an example myself, but it's difficult to know when I'll be able to.