Skip to content

Instantly share code, notes, and snippets.

@jp8998
jp8998 / basket.ts
Created December 7, 2018 08:14 — forked from mrcrowl/basket.ts
Example of using vuex-type to create strongly-typed vuex store access
// path: store/basket/basket.ts (module)
import { RootState } from "../../store"
import inventory, { Product } from "../inventory/inventory"
export interface Item { productId: string, quantity: number }
export interface DisplayItem { product: Product, quantity: number }
export interface BasketState { items: Item[], isLoading: boolean }
const initialBasketState: BasketState = { items: [], isLoading: false }