Skip to content

Instantly share code, notes, and snippets.

@SebastianHGonzalez
Last active January 2, 2019 18:51
Show Gist options
  • Save SebastianHGonzalez/78dc1a1664a01f89fb2af2ba04f27b6a to your computer and use it in GitHub Desktop.
Save SebastianHGonzalez/78dc1a1664a01f89fb2af2ba04f27b6a to your computer and use it in GitHub Desktop.
class LoggerAspect {
constructor(logger) {
this.logger = logger;
}
before(context, joinPointName, ...args) {
this.logger.log("logging");
}
}
class TimeAspect {
constructor(timer, logger) {
this.timer = timer;
this.logger = logger;
}
before() {
this.timer.start();
}
after() {
this.timer.stop();
this.logger.log(this.timer.getTime());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment