Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

decorator-advice

1.0.2 • Public • Published

ES7 aspect decorator

Build Status

Getting Started

npm i decorator-advice

Usage

 
import { before, after, error, around } from 'decorator-advice'
 
const logging = msg => console.log(msg);
class User {
 
  @before(() => logging('hello') )
  getUser() {
    // ... implementation ...
  }
 
}
 

If you use this in CommonJS or AMD environment:

var aspectModule = require('decorator-advice');
var aspect = aspectModule.default;
var before = aspectModule.before;

License

MIT

install

npm i decorator-advice

Downloadsweekly downloads

6

version

1.0.2

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability