vendredi 25 mars 2016

Ember Component cleanup code

just imagine there are more components rendered in web page, and when i click a link, i route to home page, which fills the entire page. (means all components gone in UI)

What are all the things i should make sure to clean up to avoid memory leaks?

Few examples:

If i used Ember.addObserver in component's didInsertElement, i should remove it using Ember.removeObserver in willDestroyElement method.

And any event handlers attached should be detached.

Can i get some more examples / link to see what are all the things i should cleanup and where?




Aucun commentaire:

Enregistrer un commentaire