Created
June 18, 2015 21:42
-
-
Save jrhe/75b45949e51c41a0d3dd to your computer and use it in GitHub Desktop.
Chained cp not firing
This file contains hidden or 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
import Ember from 'ember'; | |
import DS from 'ember-data'; | |
// results is never updated apart from for the initial reference (from a template) | |
export default DS.Model.extend({ | |
isNotSaving: Ember.computed.not('isSaving'), | |
isNotDirty: Ember.computed.not('isDirty'), | |
isSaved: Ember.computed.and('isNotSaving', 'isNotDirty'), | |
results: Ember.computed('isSaved', function() { | |
return ...; | |
}) | |
}); | |
// Works but fires too often if I don't check the parameters and I need to cache results incase I want the results to remain the same | |
export default DS.Model.extend({ | |
results: Ember.computed('isDirty', 'isSaving', function() { | |
return ...; | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment