Advanced uses of computed Properties


#1

Hi!

I’ve been having a look at https://github.com/emberjs/ember.js/blob/master/packages/ember-metal/lib/computed.js#L482 and I’ve seen that computed properties are actually way more powerful that they’re documented on the guides.

Some really useful straightforward uses cases are:

Ember.Object.create({
  propertyA: Ember.computed.empty('anotherProperty'),
  propertyB: Ember.computed.not('anotherProperty'),
  propertyB: Ember.computed.equal('anotherProperty', "Ed Balls")
});

But I don’t really get how the more advanced cases work: https://github.com/emberjs/ember.js/blob/master/packages/ember-metal/lib/computed.js#L617

I could really use some clarification - I suspect I might be writing an aweful lot of boilerplate that I could avoid with a proper use of those :smiley:.

Once I get how they work, I could definitely try to add some documentation to the guides.

Thanks!


#2

Oh, I just realized this post’s against the Discuss terms :frowning:

Can’t find a way to delete it! Sorry!