Skip to content

Commit

Permalink
Fix @deprecated decorator example (#327)
Browse files Browse the repository at this point in the history
* Fix @deprecated decorator example

* Add missing word
  • Loading branch information
msakrejda authored Oct 16, 2020
1 parent ae89ea2 commit a349e17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export function deprecated(element, {kind}) {
case 'method':
case 'getter':
case 'setter':
return wrapDecorated(element);
return wrapDeprecated(element);
case 'field': {
let { get, set } = element;
return { get: wrapDeprecated(get), set: wrapDeprecated(set) };
Expand Down Expand Up @@ -582,7 +582,7 @@ The return value is interpreted based on the type of decorator. The return value
- field: An object with three properties (each individually optional):
- `get`: A function of the same form as the `get` property of the first argument
- `set`: Ditto, for `set`
- `initialize`: A called with the same arguments as `set`, which returns a value which is used for the initializing set of the variable. This is called when initially setting the underlying storage based on the field initializer or method definition. This method shouldn't call the `set` input, as that would trigger an error. If `initialize` isn't provided, `set` is not called, and the underlying storage is written directly. This way, `set` can count on the field already existing, and doesn't need to separately track that.
- `initialize`: A function called with the same arguments as `set`, which returns a value which is used for the initializing set of the variable. This is called when initially setting the underlying storage based on the field initializer or method definition. This method shouldn't call the `set` input, as that would trigger an error. If `initialize` isn't provided, `set` is not called, and the underlying storage is written directly. This way, `set` can count on the field already existing, and doesn't need to separately track that.
- Init method: An object with the properties
- `method`: A function to replace the method
- `initialize`: A function with no arguments, whose return value is ignored, which is called with the newly constructed object as the receiver.
Expand Down

0 comments on commit a349e17

Please sign in to comment.