Skip to content

State doesn't seem to be persisted using Nuxt 2 and secure-ls package #17

Answered by soc221b
theolavaux asked this question in Q&A
Discussion options

You must be logged in to vote

The createPersistedStatePlugin function will return an install function, we need to register it:

- const piniaPersistedStatePlugin = () => {
+ const piniaPersistedStatePlugin = (context) => {
  const ls = new SecureLS({ isCompression: false });

- createPersistedStatePlugin(/* ... */);
+ const install = createPersistedStatePlugin(/* ... */);
+ install(context);
};

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@soc221b
Comment options

Answer selected by soc221b
Comment options

You must be logged in to vote
1 reply
@theolavaux
Comment options

Comment options

You must be logged in to vote
2 replies
@soc221b
Comment options

@theolavaux
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
documentation Improvements or additions to documentation
2 participants
Converted from issue

This discussion was converted from issue #16 on March 17, 2022 13:55.