Skip to content

Instantly share code, notes, and snippets.

@SebastianHGonzalez
Last active January 21, 2019 13:24
Show Gist options
  • Select an option

  • Save SebastianHGonzalez/23bea3cfb8e9f3e783cb2d4dee21e55c to your computer and use it in GitHub Desktop.

Select an option

Save SebastianHGonzalez/23bea3cfb8e9f3e783cb2d4dee21e55c to your computer and use it in GitHub Desktop.
first pointcutdefinition implementation
class PointCutDefinition {
/**
TODO
**/
decorateTargets(decorator) {
this.decorateMethods(decorator);
}
decorateMethods(decorator) {
this.targetClasses
.map(targetClass => targetClass.prototype)
.forEach(prototype => {
const targetMethods = this.getTargetMethods(targetClass);
targetMethods.forEach(targetMethod => {
prototype[targetMethod.name] = decorator(targetMethod)
})
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment