Skip to content

Commit

Permalink
Extend decorator documentation (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored Apr 20, 2021
1 parent a42d720 commit a7e8b18
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,13 @@ Refer to the [caching strategies](#caching-strategy) section for more informatio

### mem.decorator(options)

Returns a TypeScript decorator which memoizes the given function.
Returns a [decorator](https://github.com/tc39/proposal-decorators) to memoize class methods.

Notes:

- Only class methods and getters/setters can be memoized, not regular functions (they aren't part of the proposal);
- Only [TypeScript’s decorators](https://www.typescriptlang.org/docs/handbook/decorators.html#parameter-decorators) are supported, not [Babel’s](https://babeljs.io/docs/en/babel-plugin-proposal-decorators), which use a different version of the proposal;
- Being an experimental feature, they need to be enabled with `--experimentalDecorators`; follow TypeScript’s docs.

#### options

Expand Down

0 comments on commit a7e8b18

Please sign in to comment.