Skip to content

Commit

Permalink
Release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks committed Feb 14, 2018
2 parents b1d8c9f + 4f30365 commit 614c512
Show file tree
Hide file tree
Showing 13 changed files with 767 additions and 922 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

<!-- ## [Unreleased] -->

## [1.1.0] - 2018-02-14
- Allow `@property` to be used together with `@computed` so that its `type` can be set.
- Fix bug where `@observe` could not be used with `Polymer.mixinBehaviors`.

## [1.0.2] - 2018-01-26
- Fix missing generated files from `1.0.1` release.

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ get fooBar() {
}
```

> ⚠️ **NOTE**: Since TypeScript 2.7, any use of `@computed` with >1 dependencies
> will not compile unless the generic type parameter is specified explicitly
> (either with the element class as shown below, or simply with `any`). See
> [#48](https://github.com/Polymer/polymer-decorators/issues/48) for details.
For optional additional type saftey, pass your custom element class as a
generic parameter. This allows TypeScript to check that all of your
dependencies are valid properties.
Expand All @@ -156,6 +161,17 @@ get fooBar() {
}
```

To set the type of a computed property when the Metadata Reflection API is not
available, apply an additional `@property` decorator. Note that the `@property`
decorator should be applied first, but since decorators are executed bottom up,
it should be written second:

```ts
@computed<MyElement>('foo', 'bar')
@property({type: String})
get fooBar() {
```
To define a computed property with more complex dependency expressions for
which you may want to receive change values as arguments (e.g. sub-properties,
splices, wildcards, etc.), or to set additional property options, define a
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "polymer-decorators",
"homepage": "https://github.com/Polymer/polymer-decorators",
"version": "1.0.2",
"version": "1.1.0",
"authors": [
"The Polymer Project Authors"
],
Expand Down
Loading

0 comments on commit 614c512

Please sign in to comment.