Use listenOnce in amp-story
See original GitHub issueWe have many places in amp-story
code that add an event listener but do not remove it. For this, we can refactor to use listenOnce
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Event bus implementation for clickable actions in amp story
click listeners in stories needs to be centrally managed. The navigation service needs an API similar to the anchor mutators but not restricted ......
Read more >How do events and event objects work in amp-story? Is there ...
When an event occur in HTML, the event belongs to a certain event object, like a mouse click event belongs to the MouseEvent...
Read more >Documentation: <amp-story-panning-media> - amp.dev
The amp-story-panning-media component provides a way to pan and zoom an image between pages in Web Stories. Usage. Use the amp-story-panning-media to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@newmuis I attempted to use
listenOnce
but that one removes the listener as soon as the event is received, it just executes each handler once for each event, e.g. next page would work just once.So instead, I refactored this with listen and stored the unlisteners than then are called in unlayoutCallback.
PR #17004 is ready for review.
c.c. @mrjoro
Sure! Thanks @juanlizarazo!