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

Readme

Keywords

Package Sidebar

Install

npm i decorator-advice

Weekly Downloads

1

Version

1.0.2

License

none

Last publish

Collaborators

  • javarouka