decorator-when
v2.0.1
Published
Simple decorator for short-cutting method execution
Downloads
13
Maintainers
Readme
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