Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the lit-html event context to this and add a @eventOptions decorator #244

Merged
merged 4 commits into from
Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Changed

### Added
* A `disconnectedCallback()` function was added (https://github.com/Polymer/lit-element/pull/213).

### Changed
* LitElement changed to a non-abstract class to be more compatible with the JavaScript mixin pattern
(https://github.com/Polymer/lit-element/issues/227).
([#227](https://github.com/Polymer/lit-element/issues/227)).
* Update lit-html dependency to ^0.12.0 ([#244](https://github.com/Polymer/lit-element/pull/244)),
* Passes the components `this` reference to lit-html as the `eventContext`, allowing unbound event listener methods. ([#244](https://github.com/Polymer/lit-element/pull/244)).
### Added
* A `disconnectedCallback()` method was added to UpdatingElement([#213](https://github.com/Polymer/lit-element/pull/213)).
* Added `@eventOptions()` decorator for setting event listener options on methods ([#244](https://github.com/Polymer/lit-element/pull/244)).
<!-- ### Removed -->
<!-- ### Fixed -->

## [0.6.1] - 2018-09-17

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ and renders declaratively using `lit-html`.
* expression: ``` html`<div>${this.disabled ? 'Off' : 'On'}</div>` ```
* property: ``` html`<x-foo .bar="${this.bar}"></x-foo>` ```
* attribute: ``` html`<div class="${this.color} special"></div>` ```
* event handler: ``` html`<button @click="${(e) => this._clickHandler(e)}"></button>` ```
* event handler: ``` html`<button @click="${this._clickHandler}"></button>` ```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth mentioning (here or elsewhere) that listener is bound to element (since that's not standard lit-html)?

Also, worth showing a non-decorator pattern for options?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please show/add as many explanations and examples as possible on things like this! :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README is about to be replaced with real docs.... It already didn't say how to set up event handlers correctly, so I think this at least isn't any worse.


## Getting started

Expand Down
80 changes: 40 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"typings": "lit-element.d.ts",
"dependencies": {
"lit-html": "^0.11.4"
"lit-html": "^0.12.0"
},
"publishConfig": {
"access": "public"
Expand Down
Loading