Vuex vs Pinia | Vue 3 Tutorial
HTML-код
- Опубликовано: 12 июн 2024
- Vue core team member Ben Hong presents the first two lessons in his new course "From Vuex to Pinia". To watch the rest of the course, visit: www.vuemastery.com/courses/fr...
Ready to master Vue.js? With weekly Vue js tutorials on the latest topics, and exclusive content with Evan You (the creator of Vue), Vue Mastery is the ultimate learning resource for Vue developers to level-up their skills. Watch more free Vuejs tutorials 👉 www.vuemastery.com/courses
Get in touch 👉 team@vuemastery.com
0:00 Overview
Link mentioned: www.vuemastery.com/courses/vu...
0:38 What is Pinia?
1:28 What you'll learn in this course
2:16 Why Migrate from Vuex?
2:45 Benefits of Pinia: Simpler API
4:02 Benefits of Pinia: DevTool Support
4:30 Benefits of Pinia: TypeScript Support
5:05 Is your app being actively developed?
5:34 Let's ReVue
Keep watching this course on VueMastery.com - Наука
Someone had fun editing this video.
Haha. For sure! 💛
Pinia is Vuex simplified and, with TypeScript support. Great! ❤️
🍍 You can watch the full "From Vuex to Pinia" course here: www.vuemastery.com/courses/from-vuex-to-pinia/what-is-pinia
It's briefly mentioned in the docs, but we can pass a function instead of an object as 2nd argument in defineStore(), and it will look like the setup method of Composition API. For me, it's even better, because it matches Vue 3's workflow and syntax.
export const useMainStore = defineStore('main', () => {
const count = ref( 0 )
function increase() {
count.value += 1
}
return {
count,
increase
}
})
Defining stores this way, is so nice. You don’t have to deal anymore with that ugly state, actions and getters object
I love it! Only a real javascript dev can look at syntax that messed up and dare to use the word "simplicity"
this changes are incredible, i am super happy for differences, thank you team of Vue.
I'm super interested in knowing what are you using to create this video typography and graphic motions, it looks super cool. :D
4:34 is there any chance the devtool will find its way into device inspector too? state debugging is quite hard without it
I love Vuex but after migrate to Pinia, I can say Pinia is simpler and easier to use, full typescript support.
I Love Pinia, Good Job guys!
yea im glad that i stiped using vue.
oh lucky i browse more video before start coding in vue, so much better framework flood out continuously.
may be it's mobx version against redux in react. Well that how open source works, any one can develop library and claim its better than the other. On the end, it's just a tools, take what ever click on you and call it a day.
3:15 in and I still haven't learned anything about Pinia 🤔
7:08 in and still haven't learned anything about Pinia :)
This is VueMastery guys, you need to pay to watch the whole crap. This is just the introductory video.
It’s peen-ya… no pin-ee-uh.
Great informative video :)
simplifying my life I always hated those messy Vuex stuff same when I used to learn GraphQL
I liked the video, however the background music is really annoying. The parts without music were clearer and eaasy to understand.
Looks like i wasnt the only that dislike Vuex and hadnt use it all these while.
Whenever I learn vue3 I think ill drop vuex for it
Oh god.
On the one hand it is good that Vue is developing.
but on the other hand - IT IS A HOT MESS.
New version, composition API, and now new state manager. Not to mention TypeScript is becoming the norm. I get that I don't need to learn all of this but if I want to find a job in Vue I can encounter projects with any number of different combination of those. It is becoming impossible to just say "I'm proficient in Vue" because there is so much variation.
I'm a gonna go ahead and have a complain. All my opionions.
re: 'vuex is complicated'... Bullshit...the counter action is not necessary, if there is no async fetch required, just use the mutation....Mutations are specifically for mutation while Actions are for handling async fetches, it's so simple, why u gotta fuck it up and conflate/complex the 2 things back together?
re: vuex doesn't work with typescript.. bullshit, it works fine
re: invoking mutations with a string... yes agree, this is a pain.
re: pinia is 'simpler'.. conflating/complecting 2 things which are different is not simpler... it's more complex..its in the word.
re: use it because it's brand new.... this is not a reason
You haven't changed my opinion that splitting state management into another lib is a dumb idea.
Haha ReVue lol
Vuex guidelines when it came out: you should separate vuex into mutations and actions, DO NOT CALL MUTATIONS FROM COMPONENTS.
It took you this many years to realise the separation is useless? JavaScript world is such a joke
It looks like a good lesson on over-engineering for the team.
for gods sake, please stop using the easiest toy examples like a counter app. I can't see it anymore. it doesnt help.
its already easier in vueX , structure and everything. wouldn't it be possible if we remove the mutation from VueX and make it work everything (async etc) with just actions?
so we can just use $store.dispatch() or just $store.stateProperty.
Is not already easier in Vuex. Pinia was fused with Vuex 5 so they are basically the same thing now.
So if you are using Vuex 5 you are using Pinia.