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

Persistent Storage / Access the done / undone stack #45

Closed
billyschonenberg opened this issue Aug 27, 2020 · 5 comments
Closed

Persistent Storage / Access the done / undone stack #45

billyschonenberg opened this issue Aug 27, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@billyschonenberg
Copy link

I have been using this plugin for some time, thanks!

I am using it in some hybrid app I'm building. What would be great if can somehow persist the whole undo/redo stack to local storage so the undo functionality keeps working between reloads.

Is this feasible? Or do I need to try another way?

Thanks,
Billy

@billyschonenberg
Copy link
Author

Any comments / thoughts ?

@andrewbeng89
Copy link
Member

Hi @billyschonenberg thank you for the feedback and comment about accessing the done/undone stacks. Also, apologies on only just responding to your query now.

Regarding creating an interface to access the stacks, this should be do-able and a useful feature enhancement. I would however recommend that implementing persistence in local storage be done within the scope of your application. This would allow greater flexibility within the app, while keeping the scope of this plugin streamlined.

Does this approach sound reasonable?

@billyschonenberg
Copy link
Author

Thanks for your response @andrewbeng89. No problem about the reaction time!

Your approach is what I have in mind. I already made the local storage portion of the implementation, since I agree it's outside the scope of the project. So I'll just keep watching this project to see when/if the stacks are accessible.

Thanks again,
Billy

@andrewbeng89 andrewbeng89 added the enhancement New feature or request label Sep 25, 2020
andrewbeng89 added a commit that referenced this issue Sep 25, 2020
andrewbeng89 added a commit that referenced this issue Oct 1, 2020
* feat(#45): expose done and undone stacks

* feat(#45): scaffold necessary state, mutation and action members

* test(#45): update test store

* chore: build WIP

* chore: refactor mutation of exposed config prop from internal "setConfig" function

* chore: formatting

* test(#45): export factory for new store with exposed done/undone stacks

* chore: formatting

* test(#45) coverage for updating the exposed done/undone stacks

* docs(#45): write feature documentation

* chore: build

* docs: include note for exposeUndoRedoConfig as second param of plugin helpers

* test: inspect done and undone stack in non-namespaced store

* chore: format

* v1.4.0
@andrewbeng89
Copy link
Member

Hi @billyschonenberg this feature is now available in the latest 1.4.0 release. Please have a go and let me know if there's anything which doesn't work as expected. 🙂

@billyschonenberg
Copy link
Author

Thanks for your work! I'll try it out and report back here if anything is amiss. 👍

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

No branches or pull requests

2 participants