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] Events: Explain "Add your event listener as late as possible" #533

Closed
ghost opened this issue Feb 5, 2019 · 1 comment
Closed

Comments

@ghost
Copy link

ghost commented Feb 5, 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.  

Expand on this, why is it ok to add event listeners in templates

@justinfagnani FYI

@kevinpschaaf
Copy link
Member

The lit.dev docs for event listeners now include an Optimizing for Performance section which has some treatment on performance patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants