Skip to content

Instantly share code, notes, and snippets.

@jrhe
Created June 18, 2015 21:42
Show Gist options
  • Save jrhe/75b45949e51c41a0d3dd to your computer and use it in GitHub Desktop.
Save jrhe/75b45949e51c41a0d3dd to your computer and use it in GitHub Desktop.
Chained cp not firing
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