From 926dba32c05ba7cc6d3e86e5820b029fdf79fd44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Santos?= Date: Thu, 7 May 2020 14:01:37 +0100 Subject: [PATCH] Fixes #227 - Update NuxtJS instructions (#269) --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 459418c..6dac136 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Or configured to use with [secure-ls](https://github.com/softvar/secure-ls) ### Nuxt.js -It is possible to use vuex-persistedstate with Nuxt.js. Due to the order code is loaded in, vuex-persistedstate must be included as a NuxtJS plugin: +It is possible to use vuex-persistedstate with Nuxt.js. It must be included as a NuxtJS plugin: ```javascript // nuxt.config.js @@ -73,13 +73,11 @@ plugins: [{ src: '~/plugins/localStorage.js', ssr: false }] import createPersistedState from 'vuex-persistedstate' export default ({store}) => { - window.onNuxtReady(() => { - createPersistedState({ - key: 'yourkey', - paths: [...] - ... - })(store) - }) + createPersistedState({ + key: 'yourkey', + paths: [...] + ... + })(store) } ```