Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check action name on undo and redo #184

Open
hsavit1 opened this issue Sep 24, 2024 · 2 comments
Open

Check action name on undo and redo #184

hsavit1 opened this issue Sep 24, 2024 · 2 comments
Labels
question Further information is requested

Comments

@hsavit1
Copy link

hsavit1 commented Sep 24, 2024

Hello,

It would be really convenient for me to be able to check the name of the action that changed the zustand state. Is there a technique to do this?

@hsavit1
Copy link
Author

hsavit1 commented Sep 24, 2024

Imo every time the state changes, i would like for it to write to the pastStates + futureStates arrays with an object that looks something like {stateChange: change, actionName: name}

@charkour
Copy link
Owner

Hi @hsavit1, you should be able to do this by creating middleware for the temporal store: https://github.com/charkour/zundo#wrap-temporal-store

@charkour charkour added the question Further information is requested label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants