Skip to content

Commit

Permalink
refactor: Migrate to vuex-persistedstate
Browse files Browse the repository at this point in the history
This also reduces the bundle size
  • Loading branch information
Hanziness committed Dec 30, 2020
1 parent da81b55 commit 25918ad
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"vue-material-design-icons": "^4.10.0",
"vue-native-notification": "^1.1.1",
"vuelidate": "^0.7.5",
"vuex-persist": "^2.2.0"
"vuex-persistedstate": "3"
},
"devDependencies": {
"@aceforth/nuxt-optimized-images": "^1.3.0",
Expand Down
8 changes: 4 additions & 4 deletions plugins/vuex-persist.client.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import VuexPersistence from 'vuex-persist'
import VuexPersistence from 'vuex-persistedstate'

export default function ({ store }) {
// init vuex-persist only on settings
// init vuex-persistedstate only on settings
new VuexPersistence({
key: 'user-settings',
storage: window.localStorage,
modules: ['settings']
}).plugin(store)
paths: ['settings']
})(store)
}
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5225,11 +5225,6 @@ flat@^5.0.0:
resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241"
integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==

flatted@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==

flatted@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.0.tgz#a5d06b4a8b01e3a63771daa5cb7a1903e2e57067"
Expand Down Expand Up @@ -10509,6 +10504,11 @@ shelljs@^0.8.3:
interpret "^1.0.0"
rechoir "^0.6.2"

shvl@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/shvl/-/shvl-2.0.1.tgz#e49c21b7f223041dd3912c5ce9abf2474b69e680"
integrity sha512-VU7R5Uxp38LKHooGuZe0TcX2EPK95nn8DvclAvTPyD9/qHmXvt3dR2pJ4JLZ8uLjxQNQ3zNLFJCreteIj3cvpw==

signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
Expand Down Expand Up @@ -12039,13 +12039,13 @@ vuelidate@^0.7.5:
resolved "https://registry.yarnpkg.com/vuelidate/-/vuelidate-0.7.6.tgz#84100c13b943470660d0416642845cd2a1edf4b2"
integrity sha512-suzIuet1jGcyZ4oUSW8J27R2tNrJ9cIfklAh63EbAkFjE380iv97BAiIeolRYoB9bF9usBXCu4BxftWN1Dkn3g==

vuex-persist@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/vuex-persist/-/vuex-persist-2.3.0.tgz#f3d21b6d631078667d6834f2f74442ee332ac281"
integrity sha512-0QPZQYgQ72SbXkdwctXGFQJhlRiySP0z9wHDBTlyHvNy3CneKvgyJ7Lfob8NUiYbaurJepaC+JFynwshp59FGA==
vuex-persistedstate@3:
version "3.1.0"
resolved "https://registry.yarnpkg.com/vuex-persistedstate/-/vuex-persistedstate-3.1.0.tgz#a710d01000bff8336bc3b03fa3ef42e376094b71"
integrity sha512-nRiCe1qDdDrcveFQzTw0QGEj3dRpwN19BailSSwfhe4eUNNQ+9S/ApKnDEAuyw95cigOtSPciMEhdsC0qNUiKQ==
dependencies:
flatted "^2.0.0"
lodash "^4.17.19"
deepmerge "^4.2.2"
shvl "^2.0.0"

vuex@^3.6.0:
version "3.6.0"
Expand Down

0 comments on commit 25918ad

Please sign in to comment.