Skip to content

Instantly share code, notes, and snippets.

mrcrowl

  • New Zealand
Block or report user

Report or block mrcrowl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mrcrowl
mrcrowl / basket.ts
Last active Sep 13, 2019
Example of using vuex-type to create strongly-typed vuex store access
View basket.ts
// 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 }
You can’t perform that action at this time.