Great video as always Justin, I really appreciate the cadence of your voice. I've really enjoyed a handful of your videos, but today you got my sub. See you soon
Yea interesting library, main advantage is that you have access to the devtool (which you forgot to show!). Also, in Vue2 you could have more or less the same feature using Vue.observable function (which has been replaced by the reactive function in Vue3!), so since vue 2 you could already drop vuex and enjoy a global state mangement with awesome type checking features ! The only downsides I have found about dropping vuex and doing self made store is that you do not have access to the devtools anymore and some vuex plugins. But I never used any vuex plugins so it's ok for my use cases, and the devtools was useful because of the lack of great type checking while using vuex. For me, vuex might be dead for good!
Would it be better to destructure the cart variable from within setup, so that it's less prone to breaking? You wouldn't know it will break in the template at runtime until you did something wrong like: cart.deleteAllItems(). Better to do: const { itemsCount } = useCartStore() return { itemsCount }
The store is an object wrapped with reactive. You could use toRefs or enable template interpolation service so you know in the template if something is broken (feature in beta).
Thanks for this tutorial! I just followed as it goes, but I'm getting this issue, any advice to fix it? : PS C:\Learning\Vue\Pinia\pinia-shopping-cart> npm run serve > pinia-shopping-cart@0.1.0 serve > vue-cli-service serve INFO Starting development server... ERROR ValidationError: Progress Plugin Invalid Options options should NOT have additional properties options should NOT have additional properties options should NOT have additional properties options should pass "instanceof" keyword validation options should match exactly one schema in oneOf ValidationError: Progress Plugin Invalid Options options should NOT have additional properties options should NOT have additional properties options should pass "instanceof" keyword validation options should match exactly one schema in oneOf at validateOptions (C:\Learning\Vue\Pinia\pinia-shopping-cart ode_modules\webpack ode_modules\schema-utils\src\validateOptions.js:32:11) at new ProgressPlugin (C:\Learning\Vue\Pinia\pinia-shopping-cart ode_modules\webpack\lib\ProgressPlugin.js:62:3) at new Progress (C:\Learning\Vue\Pinia\pinia-shopping-cart ode_modules\progress-webpack-plugin\index.js:25:21) at new progressPlugin (C:\Learning\Vue\Pinia\pinia-shopping-cart ode_modules\progress-webpack-plugin\index.js:127:10) at C:\Learning\Vue\Pinia\pinia-shopping-cart ode_modules\webpack-chain\src\Plugin.js:14:18 at Object.toConfig (C:\Learning\Vue\Pinia\pinia-shopping-cart ode_modules\webpack-chain\src\Plugin.js:78:22) at C:\Learning\Vue\Pinia\pinia-shopping-cart ode_modules\webpack-chain\src\Config.js:129:63 at Array.map () at module.exports.toConfig (C:\Learning\Vue\Pinia\pinia-shopping-cart ode_modules\webpack-chain\src\Config.js:129:40) at Service.resolveWebpackConfig (C:\Learning\Vue\Pinia\pinia-shopping-cart ode_modules\@vue\cli-service\lib\Service.js:261:34)
Great video, thanks for introducing to pinia. Errors importing Pinia "pinia.mjs 1083:44-52 Can't import the named export 'computed' from non EcmaScript module (only default export is available)" checking on Pinia github issues.
If you like piña coladas... 🎶🎤🍍 Awesome library... I really think Vuex should be completely rethought (even after the improvements of v4) or come with a better alternative with official support inside the core ecosystem. This is for sure an alternative that I'm gonna try in the next project.
@@luk318 but how. Do you have any social media account through which we can connect. Yeah I read one article on how manage state without vuex by using composition api.