2.0.0 • Published 5 years ago

@thenja/decorators v2.0.0

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

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.