Skip to content

Instantly share code, notes, and snippets.

@bakerface
Created April 3, 2021 16:58
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 bakerface/0da3f4c33fcfbe02ea585a4a33390134 to your computer and use it in GitHub Desktop.
Save bakerface/0da3f4c33fcfbe02ea585a4a33390134 to your computer and use it in GitHub Desktop.
TypeScript Mixin
export type Constructor<T> = new (...args: any[]) => T;
export interface Mixin<Features, Requirements = any> {
<T extends Constructor<Requirements>>(Base: T): T & Constructor<Features>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment