5.0.0 • Published 2 months ago

@boost/decorators v5.0.0

Weekly downloads
835
License
MIT
Repository
github
Last release
2 months ago

Decorators - Boost

build status npm version

Experimental decorators for common patterns.

import { Bind, Memoize } from '@boost/decorators';

class Example {
  @Bind()
  referencedMethod() {
    return this; // Class instance
  }

  @Memoize()
  someExpensiveOperation() {
    // Do something heavy
  }
}

Features

  • @Bind - Autobind a method's this to the class context.
  • @Debounce - Defer the execution of a method in milliseconds.
  • @Deprecate - Mark a property, method, or class as deprecated.
  • @Memoize - Cache and return the result of a method execution.
  • @Throttle - Throttle the execution of a method to a timeframe in milliseconds.

Installation

yarn add @boost/decorators

Documentation

5.0.0

2 months ago

5.0.0-alpha.2

2 months ago

5.0.0-alpha.1

3 months ago

4.0.0

2 years ago

4.0.0-alpha.1

2 years ago

3.0.0

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

4 years ago