Library of stage-0 JavaScript decorators (aka ES2016/ES7 decorators but not accurate) inspired by languages that come with built-ins like @override, @deprecate, @autobind, @mixin and more. Popular with React/Angular, but is framework agnostic.
MIT License
4.52k
stars
263
forks
source link
Explain applyDecorators() for a function prototype #150
hi, any chance somebody has example code for how to use applyDecorators() on a non-class-method stand-alone kind of function? I don't know what key to use for the property.
The docs only say:
// This works on regular function prototypes
// too, like `function Foo() {}`
applyDecorators(Foo, {
getFoo: [autobind]
});
hi, any chance somebody has example code for how to use applyDecorators() on a non-class-method stand-alone kind of function? I don't know what key to use for the property.
The docs only say: