N
Nuxtβ€’10mo ago
Alberto

To much pinia versions! 🍍?

So far, I've heard that there are different approaches to Pinia: Pinia v1 (Options API), Pinia v2 (Composition API), with Pinia currently at version 2.1.7. And there's also something called pinia/nuxt": "^0.5.1". Which one should I use in Nuxt 3?
8 Replies
owljackob
owljackobβ€’10mo ago
Use @pinia/nuxt.
Alberto
AlbertoOPβ€’10mo ago
Thanks! so I follow the structure of Pinia v1 (Options API)?
manniL
manniLβ€’10mo ago
I'd use setup stores if possible
Alberto
AlbertoOPβ€’10mo ago
so, 'setup stores' are a style that I should use, Im taking notes since I dont know about this yet I want to store in pinia de logic of auth, and user, makes sense?
owljackob
owljackobβ€’10mo ago
It's closer to Composition API from Vue and that is definitely a way to go.
Alberto
AlbertoOPβ€’10mo ago
the logic has some complexity, with the ID I fecth for profile info... And I thought, this is context And everyone is talking about Composition API could you tell me about the setup stores? I want to search how they are usefull and closer to Composition API
manniL
manniLβ€’10mo ago
Pinia 🍍
Intuitive, type safe, light and flexible Store for Vue
Alberto
AlbertoOPβ€’10mo ago
thanks! ah, so options is using state:, actions: and setup stores is more like a regular component ok, I should go deeper Thanks
Want results from more Discord servers?
Add your server