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

Usage with useReducer? #9

Open
tremby opened this issue Feb 24, 2019 · 2 comments
Open

Usage with useReducer? #9

tremby opened this issue Feb 24, 2019 · 2 comments

Comments

@tremby
Copy link

tremby commented Feb 24, 2019

Is it possible to use this with a reducer function from React's built-in useReducer? I'm struggling to figure out how to put them together. What I want is to be able to undo/redo changes calls to the reducer have caused.

@tremby
Copy link
Author

tremby commented Feb 24, 2019

I found this which works great for my use case: https://github.com/vnglst/write-only/blob/master/src/useUndoableReducer.js

Leaving open just in case.

@rvrita
Copy link

rvrita commented Jun 4, 2022

This library does use useReducer, but just hides the details behind the returned set of functions (undo, redo, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants