Created
October 20, 2015 18:49
-
-
Save joliss/9e8924695fbccee6ea41 to your computer and use it in GitHub Desktop.
This file contains 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 Router { | |
static build(stuff) { | |
// Compute compute | |
// var constructorArg = 123 | |
return new Router(constructorArg) | |
} | |
new Router(constructorArg) | |
route(location) { | |
return promise | |
} | |
} | |
class MyRouter { | |
route(location) { | |
console.log('begin routing ' + location) | |
return super(location) | |
.finally(function() { | |
console.log('end routing ' + location) | |
}) | |
} | |
// Yes, I want to inherit .build here, so MyRouter.build(stuff) works. | |
// | |
// And if `build` was a `call constructor` instead, I'd want to inherit that. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment