A yummy store management for Vue.js apps
Maya Shavin
SENIOR SOFTWARE ENGINEER
StoreFrontUI Team
VueJS Israel Organizer
Why do you need a state management (or store)?
Process of maintaining knowledge of application's inputs across multiple related data flows... to understand the condition of an app at any given time..."
import { createStore } from 'vuex'
export const globalStore = createStore({
state: () => ({
products: [],
cart: [],
user: null
}),
mutations: {
/*....*/
},
methods: {
login() {
/*...*/
},
fetchProducts() {},
addItemToCart() {}
}
})
A modular approach to store management
Seeing is believing...
Vue 3 Vue Router 4 Pinia 2 Netlify functions Vitejs
Fetch, store and display pizzas from APIs
Create a cart system (add, edit, clear)
Add pizza to cart & display cart
Make a payment using Pinia plugins
Fetch, store and display pizzas from APIs
Create a cart system (add, edit, clear)
Add pizza to cart & display cart
Make a payment using Pinia plugins
Fetch, store and display pizzas from APIs
Create a cart system (add, edit, clear)
Add pizza to cart & display cart
Make a payment using Pinia plugins
Fetch, store and display pizzas from APIs
Create a cart system (add, edit, clear)
Add pizza to cart & display cart
Make a payment using Pinia plugins
Fetch, store and display pizzas from APIs
Create a cart system (add, edit, clear)
Add pizza to cart & display cart
Make a payment using Pinia plugins
Obviously :)
It all depends...