One of the truly beautiful parts about Discourse is the fact that once logged-in you load the page once and the rest of the user experience navigates like a true software application. Much of it is javascript feeding from a predictable set of Rails API endpoints.
Here are approaches I have been trading off using in my current install:
- The “Pre-2017 triad”:
- new Event
- addEventListener to node
- setInterval to monitor
+ [insert series of conditions that can get truthy]
- Post-2017 MutationObserver() class:
- MutationObserver()
- observe w/ class-based filters
How else can we detect the Ember-based events changing the DOM inside Discourse? Are there specific events we can listen to? Are there better approaches than what I am using?
Hoping to get people to throw up some example approaches and theories.
Thanks!