Combine zundo middleware with immer & devtools
See original GitHub issuerecently, I work on a project that uses zustand store as its state manager.
- I have nested states so have to use immer middleware
- And I use typescript so for debugging I needed redux devtools
so I want to add undo & redo feature for my store but here is the problem :
This my imports
import create from "zustand";
import { immer } from "zustand/middleware/immer";
import { devtools } from "zustand/middleware";
import { UndoState ,undoMiddleware} from "zundo";
store type: export interface BookBuilderStore extends UndoState { . . . }
Issue Analytics
- State:
- Created a year ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
pmndrs/zustand: Bear necessities for state ... - GitHub
A small, fast and scalable bearbones state-management solution using simplified flux principles. Has a comfy api based on hooks, isn't boilerplatey or ...
Read more >Third-party Libraries - Zustand Documentation
zoov — State management solution based on Zustand with Module-like API. zundo — Undo and redo middleware for Zustand, enabling time-travel in your...
Read more >Stop Overcomplicating your State – Try Zustand
We just need to import the devtools middleware, and attach it to our store. ... Immer is another great package that makes reducing...
Read more >applyMiddleware - Redux
Multiple middleware can be combined together, where each middleware requires no knowledge of what comes before or after it in the chain.
Read more >How to combine state sanitizer with existing middleware in ...
applyMiddleware (thunk, logger) : applyMiddleware(thunk) // sanitizers to keep redux devtools from using excessive memory const ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @mowhcen,
I’ve released a beta version of zundo. You can install it with
npm i zundo@beta
. Please reopen the issue if you run into problems. Thanks for your patience!sounds great i will look into it 😄