Skip to content

Instantly share code, notes, and snippets.

@perjerz
Last active June 8, 2018 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perjerz/224e7ecc4043048e93875dc080115f45 to your computer and use it in GitHub Desktop.
Save perjerz/224e7ecc4043048e93875dc080115f45 to your computer and use it in GitHub Desktop.
NgRx State
export interface Item {
id: string;
name: string;
type: string;
price: string;
description: string;
}
export interface Cart {
// Define state here
// สินค้าทั้งหมดที่ได้รับจาก API เพื่อโชว์ให้ Users เลือก
displayItems: Item[],
// คู่ไอดีกับจำนวนสินค้าแต่ละชนิดที่ User มีอยู่ในรถเข็น (Cart)
selectedItems: { [id: string]: number };
}
export interface CartState {
readonly cart: Cart;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment