How to determine which property caused Computed Property to change?


#1

Is there a convenient way to tell which property would have caused a computed property to update if it is observing multiple values?

In other words given something like this:

  myComputed: function() {
    // do some work
  }.property('foo', 'bar', 'baz')

How can I easily tell whether ‘foo’, ‘bar’ or ‘baz’ triggered the change?

Can I conditionally observe changes? Meaning only update if say foo is greater than some value, etc.


#2

You could flag the changes by using observes('foo) etc, and then the next time myComputed is entered you can check which has been flagged and react accordingly.


#3

OK that would work. I was just more curious if computed properties had some internal mechanism which already does this?