question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add recommendation for event usage and firing

See original GitHub issue

For usage of events have a TLDR.

  • wire-up to local DOM via @some-event in template (let Lit do the actual wire-up)
  • wire-up events to this in constructor (no need to clean up - as it will be garbage collected on destroying)
  • wire-up to elements outside of scope (ex. window) using connectedCallback , and remove them in disconnectedCallback.

For firing events have a TLDR.

  • prefer “just” events without bubble or composed e.g. new Event('something-happened')
  • when needing data consider extending Event or using CustomEvent
  • use bubble: true if a node up the tree needs the event
  • retrain from using composed: true as it leads to event pollution
  • use composed only if absolutely needed

Add a link for details too https://dev.to/open-wc/composed-true-considered-harmful-5g59

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

0reactions
thepasslecommented, Jan 3, 2020

Maybe even a codelab?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[GA4] Recommended events - Analytics Help - Google Support
The Events report provides recommendations on events to collect based on the data you already collect or the app category in the Google...
Read more >
Navigate Meta Events Manager for website events - Facebook
You can see your web event data in Meta Events Manager after you add the Meta ... Use Test Events to check that...
Read more >
Event Planning Checklist - Special Events
Use this handy checklist to ensure your event is on track and on budget. ... Recommend they are added to your phone for...
Read more >
Adding Event Tracking & Triggering - Qualtrics
Under the Intercepts section, open the Intercepts tab and select the Intercept to which you would like to add event tracking. · Click...
Read more >
How to Host a Successful Virtual Event: 10 Tips - Hootsuite Blog
10 tips for hosting virtual events · 1. Set clear goals from the start · 2. Choose the right platform to host your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found