Skip to content

Instantly share code, notes, and snippets.

@mmmpa
Created May 9, 2016 20:37
Show Gist options
  • Save mmmpa/14282e017e77b6d8a9f428770c8ee86c to your computer and use it in GitHub Desktop.
Save mmmpa/14282e017e77b6d8a9f428770c8ee86c to your computer and use it in GitHub Desktop.
export const mix = (superclass) => new MixinBuilder(superclass);
class MixinBuilder {
constructor(private superclass: any) {
}
mix(...mixins: any[]) {
return mixins.reduce((c, mixin) => mixin(c), this.superclass);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment