All Projects → NetanelBasal → Helpful Decorators

NetanelBasal / Helpful Decorators

Licence: mit
Helpful decorators for typescript projects

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Helpful Decorators

ScreenRuler
Configurable screen measuring tool for Windows
Stars: ✭ 147 (-44.11%)
Mutual labels:  measure
toxic-decorators
Library of Javascript decorators
Stars: ✭ 26 (-90.11%)
Mutual labels:  decorators
validada
Another library for defensive data analysis.
Stars: ✭ 29 (-88.97%)
Mutual labels:  decorators
tsioc
AOP, Ioc container, Boot framework, unit testing framework , activities workflow framework.
Stars: ✭ 15 (-94.3%)
Mutual labels:  decorators
BioBalanceDetector
Bio Balance Detector's products aim to show the weak electromagnetic fields around every living being (including plants, animals and humans) and display it in a heat-map like hyper-spectral image.
Stars: ✭ 18 (-93.16%)
Mutual labels:  measure
kiwi
Built using only nodejs core. Lightweight, intuitive together with great performance and response timing.
Stars: ✭ 45 (-82.89%)
Mutual labels:  decorators
nuxt-prune-html
🔌⚡ Nuxt module to prune html before sending it to the browser (it removes elements matching CSS selector(s)), useful for boosting performance showing a different HTML for bots/audits by removing all the scripts with dynamic rendering
Stars: ✭ 69 (-73.76%)
Mutual labels:  measure
Pymeasure
Scientific measurement library for instruments, experiments, and live-plotting
Stars: ✭ 255 (-3.04%)
Mutual labels:  measure
rtiperftest
RTI Perftest is a command-line application that measures the Latency and Throughput of very configurable scenarios that use RTI Connext DDS middleware to send messages.
Stars: ✭ 38 (-85.55%)
Mutual labels:  measure
bind-observable
Provides a typescript decorator which binds class properties to observable companion properties.
Stars: ✭ 15 (-94.3%)
Mutual labels:  decorators
remote-calibrator
Measure screen size, track viewing distance and gaze, and more!
Stars: ✭ 12 (-95.44%)
Mutual labels:  measure
polog
Логирование должно быть красивым
Stars: ✭ 26 (-90.11%)
Mutual labels:  decorators
elasticmock
Python Elasticsearch Mock for test purposes
Stars: ✭ 98 (-62.74%)
Mutual labels:  decorators
reducer-class
Boilerplate free class-based reducer creator. Built with TypeScript. Works with Redux and NGRX. Has integration with immer.
Stars: ✭ 25 (-90.49%)
Mutual labels:  decorators
vue-decorator
Custom decorators to vue-class-component that fits Vue 3
Stars: ✭ 31 (-88.21%)
Mutual labels:  decorators
decky
Zero-bundle-size decorators for TypeScript
Stars: ✭ 31 (-88.21%)
Mutual labels:  decorators
route-decorators
ES7 decorators that simplify Koa and Express route creation
Stars: ✭ 71 (-73%)
Mutual labels:  decorators
Rxweb
Tons of extensively featured packages for Angular, VUE and React Projects
Stars: ✭ 262 (-0.38%)
Mutual labels:  decorators
giuseppe
A controller routing system for expressJS with TypeScript decorators and annotations
Stars: ✭ 49 (-81.37%)
Mutual labels:  decorators
state inspector
State change & method call logger. A debugging tool for instance variables and method calls.
Stars: ✭ 24 (-90.87%)
Mutual labels:  decorators

npm Build Status Commitizen friendly semantic-release Awesome

Helpful Decorators For Typescript Projects

Installation

npm install helpful-decorators
yarn add helpful-decorators

Usage

delay - Add setTimeout functionality to the method

import { delay } from 'helpful-decorators';

class Test {
 @delay(1000)
 method() {
   // ...
 }
}

debounce - Add debounce functionality to the method (options)

import { debounce } from 'helpful-decorators';

class Test {
 @debounce(1000, options)
 method() {
   // ...
 }
}

throttle - Add throttle functionality to the method (options)

import { throttle } from 'helpful-decorators';

class Test {
 @throttle(1000, options)
 method() {
   // ...
 }
}

once - Add once functionality to the method

import { once } from 'helpful-decorators';

class Test {
 @once
 method() {
   // This will run only once
 }
}

measure - measure time taken by a function to execute

import { measure } from 'helpful-decorators';

class Test {
 @measure
 doSomething() {
   // Call to doSomething took 0.35 milliseconds.
 }

 @measure
 async doSomethingHello(){
    // Call to doSomethingHello took 0.35 milliseconds. 
 }
}

Mixin - this pattern is used to achieve multiple inheritance

import { Mixin } from 'helpful-decorators';

@Mixin([Disposable, Activatable])
class Test {
}

memo - memoizes the result of the function

import { memo } from 'helpful-decorators';

class Test {
 
  @memo()
  method() {
    ...memoized
  }
}

bind - automatically bind methods to class instances

import { bind } from 'helpful-decorators';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  constructor() {
    document.body.addEventListener('click', this.onClick);
  }

  @bind
  onClick($event) {
    console.log($event);
  }
}

SortBy - sort an array by a specific property in individual elements or non-object items (By default, it sorts by type === 'string' and isDescending === true)

import { SortBy } from 'helpful-decorators';

class Test {
  
  @SortBy('name', {
    isDescending: false,
    type: 'string'
  })
  names = [ { name: 'b' }, { name: 'a' }, { name: 'c' } ];

  @SortBy('', {
    isDescending: true,
    type: 'date'
  })
  dates = [ '2020-06-17', '2020-06-16', '2020-06-20', '2020-06-10' ];

  @SortBy('', {
    isDescending: false,
    type: 'number'
  })
  numbers = [ 6, 3, 4, 1 ];
}

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].