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

[WIP] change key and restore method #204

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Razi91
Copy link

@Razi91 Razi91 commented Oct 14, 2020

This pull requests allows vuex-persist to use dynamic keys to store/restore storages.

Use case: on single browser login on multiple users. You don't want to lose store for any of account, but you want them to have separated. Using pluginInstance.setKeySuffix(user.id) it tries to restore this user's store, then uses it to store.

I'm just showing initial changes, it works, but lacks of tests.

@codecov
Copy link

codecov bot commented Oct 14, 2020

Codecov Report

Merging #204 into master will decrease coverage by 1.63%.
The diff coverage is 68.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #204      +/-   ##
==========================================
- Coverage   81.81%   80.18%   -1.64%     
==========================================
  Files           4        4              
  Lines          99      111      +12     
  Branches       36       37       +1     
==========================================
+ Hits           81       89       +8     
- Misses          6        9       +3     
- Partials       12       13       +1     
Impacted Files Coverage Δ
src/index.ts 77.01% <68.42%> (-1.66%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b7dd48...52764d4. Read the comment docs.

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 this pull request may close these issues.

None yet

1 participant