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

[stonecrop] Undo in Pinia #115

Open
agritheory opened this issue Apr 18, 2024 · 4 comments · May be fixed by #121
Open

[stonecrop] Undo in Pinia #115

agritheory opened this issue Apr 18, 2024 · 4 comments · May be fixed by #121
Assignees

Comments

@agritheory
Copy link
Owner

agritheory commented Apr 18, 2024

https://github.com/wobsoriano/pinia-undo

We want to be able to programmatically re-apply or undo changes to state, related to #102

@Alchez
Copy link
Collaborator

Alchez commented Apr 24, 2024

@agritheory @bhattdevarsh

I was checking the pinia-undo library and it seems like it'll work for basic use cases out of the box.

However, if we wanted more control over the history stack, VueUse seems to have something called useRefHistory, which provides more options above undo/redo (there's also a manual variant for this composable). I also personally trust VueUse to be maintained over the standalone library.

The only significant downside of not using pinia-undo that I can think of (maybe?) is in cross-context applications, as we'll need to deploy the composable every time a store is used in each individual context.

PS: Here's an example implementation of useRefHistory with a Pinia store.

What do you guys think?

@agritheory
Copy link
Owner Author

@Alchez I think you're right, we should use the VueUse approach

@Alchez
Copy link
Collaborator

Alchez commented Apr 25, 2024

@agritheory since the useRefHistory composable is to be used contextually for a store state variable, rather than having a general undo feature across all Pinia stores, how should we implement it both in the base package and as a story to test?

Should we have the desktop story implement this as an example?

@agritheory
Copy link
Owner Author

@Alchez I think that's fine. We will want to add a comment about it in the story file

@Alchez Alchez linked a pull request Apr 25, 2024 that will close this issue
1 task
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

Successfully merging a pull request may close this issue.

3 participants