Open mrleblanc101 opened 2 years ago
I think we can just do this, but I'm not sure it will handle every edge case:
// ~/plugins/persistedState.js
import createPersistedState from 'vuex-persistedstate';
export default ({ store, $cookies }) => {
createPersistedState({
paths: [...],
storage: {
getItem: (key) => $cookies.get(key),
setItem: (key, value) => $cookies.set(key, value, { expires: 365, secure: false }),
removeItem: key => $cookies.remove(key)
}
})(store);
};
Would it be possible to add an exemple using cookie-universal-nuxt instead of
cookie
andjs-cookies
. It combine both feature into a single plugin and is already a Nuxt module.