2.0.1 • Published 5 years ago

decorator-when v2.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

Decorator When

NPM version NPM downloads Build status Test coverage

Simple decorator for short-cutting method execution.

Installation

npm install decorator-when --save

Usage

import { when } from "decorator-when";

class Demo {
  @when(Demo.prototype.should)
  method() {
    s.apply(this, arguments);
  }
  should() {
    return Math.random() > 0.5;
  }
}

new Demo().method();

License

MIT

2.0.1

5 years ago

2.0.0

5 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

9 years ago