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

[docs] Draft events docs ready for review #413

Merged
3 commits merged into from
Feb 5, 2019
Merged

[docs] Draft events docs ready for review #413

3 commits merged into from
Feb 5, 2019

Conversation

ghost
Copy link

@ghost ghost commented Jan 3, 2019

@ghost ghost requested a review from justinfagnani as a code owner January 3, 2019 21:26
@ghost ghost self-assigned this Jan 3, 2019
@justinfagnani justinfagnani added this to the 2.0.0 milestone Jan 18, 2019
@ghost ghost changed the title Events docs (not ready yet) [docs] Draft events docs ready for review Feb 4, 2019

### Where to add your event listeners

You need to add event listeners in a method that is guaranteed to fire before the event occurs. However, for optimal loading performance, you should add your event listener as late as possible.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a TODO to expand on why this is later? From this description it sounds like you should never add handlers in the template, but then that's the first thing we show. I think it's more subtle.

Copy link
Author

Choose a reason for hiding this comment

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

}
```

### Handle an event fired by a LitElement-based component {#handle-fired-event}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since LitElement elements are the same as any other, do we really need this section?

Copy link
Author

Choose a reason for hiding this comment

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

Added for completeness to address the use case in #473

@ghost ghost merged commit 582d39c into master Feb 5, 2019
@ghost ghost deleted the fix-139 branch March 25, 2019 19:12
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[docs] Couple of events things [docs] Best practices for adding event listeners to a host element
3 participants