This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Run this script on Windows (outside of the devcontainer!) to clear out Docker data and shrink the Docker VHD. | |
| # Check if running as administrator, if not, relaunch as admin | |
| if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
| Write-Host "Script requires administrator privileges. Relaunching as administrator..." -ForegroundColor Yellow | |
| # Get the current script path | |
| $scriptPath = $MyInvocation.MyCommand.Path | |
| # Relaunch the script as administrator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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 } |