Skip to content

Instantly share code, notes, and snippets.

@bmeck
Created June 1, 2017 14:42
Show Gist options
  • Save bmeck/d4928fe9b7ad97120118318da73794a0 to your computer and use it in GitHub Desktop.
Save bmeck/d4928fe9b7ad97120118318da73794a0 to your computer and use it in GitHub Desktop.
class Super {
constructor() {
this.log = new.target.DI('log');
}
static DI(name) {
if (name === 'log') return console.log;
}
}
class Sub extends Super {
static DI(name) {
if (name === 'err') return console.error;
else return super.DI();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment