Skip to content

Instantly share code, notes, and snippets.

@SebastianHGonzalez
Created January 21, 2019 12:39
Show Gist options
  • Save SebastianHGonzalez/38ff7468b6e65dfd8116731d6630958e to your computer and use it in GitHub Desktop.
Save SebastianHGonzalez/38ff7468b6e65dfd8116731d6630958e to your computer and use it in GitHub Desktop.
point cut's around method
around(context, joinPoint, ...args) {
return this.aspects.reduce(
function aroundReducer(next, aspect) {
return function joinPointify(...newArgs) {
const newContext = this;
aspect.around(newContext, next, ...newArgs)
}
},
joinPoint
).apply(context, args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment