Skip to content

Instantly share code, notes, and snippets.

@dimitris-papadimitriou-chr
Created November 8, 2020 19:52
Show Gist options
  • Save dimitris-papadimitriou-chr/ac5aaa46f0bf369b8812fd39d58afb26 to your computer and use it in GitHub Desktop.
Save dimitris-papadimitriou-chr/ac5aaa46f0bf369b8812fd39d58afb26 to your computer and use it in GitHub Desktop.
export interface Product { getPrice: () => number;}
export var ProductA: (price: number) => Product = (price: number) => ({
getPrice: () => price
});
export var Packaging: (product: Product) => Product = (product: Product) => ({
getPrice: () => product.getPrice() + 0.5
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment