How to use watcher? #478
-
Hi, I'm getting error at end. Any idea how to use or place the code? watch(
pinia.state,
(state) => {
// persist the whole state to the local storage whenever it changes
localStorage.setItem('piniaState', JSON.stringify(state))
},
{ deep: true }
) |
Beta Was this translation helpful? Give feedback.
Answered by
posva
May 7, 2021
Replies: 1 comment 3 replies
-
you need to BTW there is a Discord chat to ask quick questions 🙂 |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
posva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you need to
import { watch } from 'vue'
orfrom '@vue/composition-api
depending on what you are using.BTW there is a Discord chat to ask quick questions 🙂