Skip to content

Instantly share code, notes, and snippets.

@YonathanMeguira
Last active July 26, 2018 14:11
Show Gist options
  • Select an option

  • Save YonathanMeguira/9eeff0192a7f4f6b077eb6df0cb24f98 to your computer and use it in GitHub Desktop.

Select an option

Save YonathanMeguira/9eeff0192a7f4f6b077eb6df0cb24f98 to your computer and use it in GitHub Desktop.
types.ts
import { ID } from '@datorama/akita';
export interface List {
name: string;
id: ID;
date: number | Date;
total: number;
items: (ID | Item)[];
}
export interface Item {
id: ID;
quantity: number;
label: string;
purchased: boolean;
}
export function createNewItem() {
return { label: '', quantity: 1, purchased: false, id: createId() };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment