xen-orchestra/@vates/decorate-with
2021-05-28 12:06:45 +02:00
..
.npmignore feat: unified .npmignore for all packages 2021-04-07 13:58:14 +02:00
index.js chore(decorate-with): named function 2021-05-28 12:06:00 +02:00
package.json feat(@vates/decorate-with): 0.0.1 2020-06-12 11:12:49 +02:00
README.md chore(decorate-with): improve doc 2021-05-28 12:06:45 +02:00
USAGE.md chore(decorate-with): improve doc 2021-05-28 12:06:45 +02:00

@vates/decorate-with

Package Version License PackagePhobia Node compatibility

Creates a decorator from a function wrapper

Install

Installation of the npm package:

> npm install --save @vates/decorate-with

Usage

decorateWith(fn, ...args)

Creates a new (legacy) method decorator from a function decorator, for instance, allows using Lodash's functions as decorators:

import { decorateWith } from '@vates/decorate-with'

class Foo {
  @decorateWith(lodash.debounce, 150)
  bar() {
    // body
  }
}

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

License

ISC © Vates SAS