Created
June 1, 2017 14:42
-
-
Save bmeck/d4928fe9b7ad97120118318da73794a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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