Skip to content

Instantly share code, notes, and snippets.

@ffMathy
Created August 22, 2018 20:32
Show Gist options
  • Save ffMathy/d495e69c79dd9f172f3a640a1090d042 to your computer and use it in GitHub Desktop.
Save ffMathy/d495e69c79dd9f172f3a640a1090d042 to your computer and use it in GitHub Desktop.
interface CalculatorInterface {
add(a: number, b: number): number;
subtract(a: number, b: number): number;
divide(a: number, b: number): number;
isEnabled: boolean;
}
class RealCalculator implements CalculatorInterface {
add(a: number, b: number) { return a + b; }
subtract(a: number, b: number) { return a - b; }
divide(a: number, b: number) { return a / b; }
get isEnabled() { return true; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment