Betta version not yet ready for production use.
Set of libraries of decorators for JavaScript, TypeScript (frameworks agnostic) and framework dedicated (Angular, React). For better understanding of concept please read following articles:
- Create set of framework agnostic decorators supported by JS and TS
- Set of TS dedicated decorators, mainly "method's params decorators"
- Create subset of specific framework decorators
- Angular
- React
- Vue.Js
JavaScript | TypeScript | Angular | VueJs | React | |
---|---|---|---|---|---|
@timer() | ✅ | ✅ | ✅ | ✅ | ✅ |
@debounce() | ✅ | ✅ | ✅ | ✅ | ✅ |
@deprecate() | ✅ | ✅ | ✅ | ✅ | ✅ |
@readonly() | ✅ | ✅ | ✅ | ✅ | ✅ |
@WwThread.asObservable() | ✅ | ✅ | ✅ | 🚫 | 🚫 |
@WwThread.toPromise() | ✅ | ✅ | ✅ | 🚫 | 🚫 |
@WwThread.toPromise() | ✅ | ✅ | ✅ | 🚫 | 🚫 |
npm i ngx-custom-decorators -S
import { timer } from 'ngx-custom-decorators';
class MyClass{
constructor(...){...}
@timer('my message to see in logs')
someLongRunMethod(){
// ....//
}
@timer() // param is optional
someLongRunMethod(){
// ....//
}
}
git clone https://github.com/danduh/ngx-custom-decorators.git
cd ngx-custom-decorators
npm i
File structure:
src/lib/
actual library of all decorators
ng build
will build the library
projects/demo/
demo app for use, test and examples
ng serve demo
will run demo app .