Ember 2 performances, is javascript event delegation in #each automagically? How to coalesce similar listeners?

I’m reading a lot (for study) about “Event delegation” and also because in this video: PhoneGap Applications with Ember: Lessons Learned | PhoneGap Day US 2016 - YouTube (minute 22:28) Alex Blom talks about: “Coalesce similar listeners” for performance reasons.

image

My question is: is Ember automagically performing about this problem?

If I have an #each with many div in it how to coalesce listeners on the parent div? Does Ember do it in my place?

Ember already delegates all events to the root element of the application (defaults to <body> if you don’t define one).
As long as none of your view / 3rd-party plugins set up additional handlers directly, all events of your application are caught at its root element

See the documentation.

1 Like