@thenja/decorators
v2.0.0
Published
Collection of useful Typescript decorators
Downloads
1
Readme
Collection of decorators.
Getting started
Install:
npm install @thenja/decorators --save
Import the decorators you want to use:
import { event, CustomEventEmitter } from '@thenja/decorators';
Available Decorators
event
Used to dispatch custom events. Useful when creating web components.
import { event, CustomEventEmitter } from '@thenja/decorators';
class FancyButton extends HTMLElement {
@event() close: CustomEventEmitter;
closeClickHandler() {
this.close.emit({ customData: 'here' });
}
}
Development
npm run build
- Compile the typscript files to javascript
npm run build -- -v <version>
- Create a distribution build
-v - (Optional) Either patch, minor or major. Increases the version number in the package.json file.