N
Nuxt2y ago
cosbgn

Best way to setup a state with vue3?

I have a state useState('billing', () => {}) inside /composables/state.js - What I would like to do, is that whenever I call const billing = useState('billing') if !billing.value.status it would $fetch the status from the backend. Since I use the billing in several components I don't want to add the login on all of them, but rather in one place, ideally inside state.js. What's the best way to do this with vue3?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server