Skip to content

Instantly share code, notes, and snippets.

@nom3ad
Last active September 23, 2021 08:32
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 nom3ad/26473caae0144ac691353b2a7f9f35eb to your computer and use it in GitHub Desktop.
Save nom3ad/26473caae0144ac691353b2a7f9f35eb to your computer and use it in GitHub Desktop.
ts-playground
class A {
    public x;
    constructor(x: number) {
        this.x =x
    }
    Foo(){

    }
}

class B extends A {
    constructor(){
        super(7)
    }
    Boo(){

    }
}

Playground Link

type Constructor = new (...args: any[]) => unknown;
function ComposeClassWithMixins<B extends Constructor, M extends Constructor[]>(base: B, ...mixins: M): any {
    return class MixedClass extends (b...

Playground Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment