Skip to content

Instantly share code, notes, and snippets.

@noyesa
Created March 17, 2015 07:49
Show Gist options
  • Select an option

  • Save noyesa/dbd585cec008b16a71de to your computer and use it in GitHub Desktop.

Select an option

Save noyesa/dbd585cec008b16a71de to your computer and use it in GitHub Desktop.
function classify(mixin) {
const Surrogate = class {};
Surrogate.prototype = mixin;
return Surrogate;
}
const baseProto = {
sayHello() {
console.log('hello');
}
};
class Subclass extends classify(baseProto) {
callBaseSayHello() {
this.sayHello();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment