Skip to content

Instantly share code, notes, and snippets.

@k1r0s
Last active February 10, 2018 13:25
Show Gist options
  • Save k1r0s/f5304bff7947e8fa8a64afd1c0c7f71b to your computer and use it in GitHub Desktop.
Save k1r0s/f5304bff7947e8fa8a64afd1c0c7f71b to your computer and use it in GitHub Desktop.
override advice implementation using kaop
const reflect = require("./reflect");
const apply = reflect.advice(meta =>
meta.target.super.prototype[meta.key].apply(meta.scope, meta.args));
const implement = reflect.advice(meta =>
meta.args.unshift(meta.target.super.prototype[meta.key].bind(meta.scope));
module.exports = {
apply,
implement
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment