Skip to content

Instantly share code, notes, and snippets.

@ColinCampbell
Created August 10, 2010 14:47
Show Gist options
  • Select an option

  • Save ColinCampbell/517389 to your computer and use it in GitHub Desktop.

Select an option

Save ColinCampbell/517389 to your computer and use it in GitHub Desktop.
// setting up an observer
var query = SC.Query.local(MyApp.Record);
var data = MyApp.store.find(query);
var f = function(data) {
if (data.get('status') & SC.Record.READY) {
// data is ready
return YES;
}
return NO; // optional, if nothing is returned then it shouldn't be removed
}
data.addFiniteObserver('status', this, f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment