Skip to content

Instantly share code, notes, and snippets.

@moltar
Created February 6, 2019 13:04
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 moltar/e322a54f2834bca9747531eb44fa4c15 to your computer and use it in GitHub Desktop.
Save moltar/e322a54f2834bca9747531eb44fa4c15 to your computer and use it in GitHub Desktop.
class A {
get a() {
return 1
}
}
class B {
get b() {
return 2
}
}
class Foo {
constructor(private hey: boolean = true) { }
get foo() {
return this.hey ? new A() : new B();
}
}
const foo = new Foo()
const loo = foo.foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment