Skip to content

Instantly share code, notes, and snippets.

@antongolub
Last active January 17, 2020 19:53
Show Gist options
  • Save antongolub/146a8be5c9430d9b0ea58cc05ca497fa to your computer and use it in GitHub Desktop.
Save antongolub/146a8be5c9430d9b0ea58cc05ca497fa to your computer and use it in GitHub Desktop.
Class and object type relations
class Foo {
foo() { return 'foo' }
}
const foo: Foo = new Foo() // Foo is used as interface
const applyMixins = <T, M>(target: T, mixin: M) => {
// typeof target refers to own class type — a function with constuctor signature
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment