Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember-Data how to know when an entity is fetched

What is the best way to know when an entity has been retrieved from the remote store in ember-data?

I need to make a call to retrieve data but I need some values from a fetched ember-data object.

At the moment I am using this approach but I am sure there is a better way.

contactLoaded: function(){
  if(!this.getPath('contact.isLoaded')){
    return;
  }

  //make call
}.observes('App.contact.isLoaded')
like image 842
dagda1 Avatar asked Oct 07 '22 06:10

dagda1


1 Answers

I am fearing it is the only way to achieve your goal, as of today... :-/

like image 181
Mike Aski Avatar answered Oct 12 '22 22:10

Mike Aski