-
-
Save charlesjolley/521957 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var query = SC.Query.local(MyApp.Record); | |
var data = MyApp.store.find(query); | |
// old way | |
var f = function() { | |
if (data.get('status') & SC.Record.READY) { | |
data.removeObserver('status', this, f); | |
// ... | |
} | |
}; | |
data.addObserver('status', this, f); | |
// proposed way | |
data.addFiniteObserver('status', this, function() { | |
if (data.get('status') & SC.Record.Ready) { | |
// ... | |
return YES; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like the proposed way... esp after writing tons of nodeJS code :0)