Skip to content

Instantly share code, notes, and snippets.

@k1r0s
Last active July 30, 2018 15:29
Show Gist options
  • Save k1r0s/c4c2fadac32e8f84253df8a1a2318b9a to your computer and use it in GitHub Desktop.
Save k1r0s/c4c2fadac32e8f84253df8a1a2318b9a to your computer and use it in GitHub Desktop.
What we can achieve using AOP with ES7 Decorators
class Invoice {
...
@beforeMethod(Validators.customValidate)
@afterMethod(Serialize)
@afterMethod(AsyncAdvices.postResult, 'url..')
@afterMethod(triggerUpdates)
doCheckout(shippingDetails){
this.shippingDetails = shippingDetails
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment