2.0.1 • Published 5 years ago
decorator-when v2.0.1
Decorator When
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