You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using two-way bindings, a computedIndirect will fire multiple observers:
importEmberfrom'ember'importcomputedIndirectfrom'ember-computed-indirect/utils/indirect'letBuggy=Ember.Object.extend({valuePath: Ember.computed(function(){return'_underlying'}),value: computedIndirect('valuePath'),bindedValueBinding: 'value',valueObserver: Ember.observer('value',function(){console.log('Observe! '+this.get('value'))})})>buggy=Buggy.create()<Object([...])>buggy.set('bindedValue',1)// fires two events<1Observe!1Observe!1>buggy.set('value',2)// fires two events with 1 receiving the wrong valueObserve!1Observe!2<2
Since components uses bindings, I cannot just convert them into Ember.computed.alias.
The text was updated successfully, but these errors were encountered:
fengb
linked a pull request
Dec 1, 2015
that will
close
this issue
Yeah, this is very peculiar. It seems it's happening because the setting of value and the setting of _underlying aren't happening atomically. I think we might I might be able to fix that by pausing change observers while modifying the underlying value, but I'm not sure. I'll noodle over this a bit and try to come up with a solution.
When using two-way bindings, a
computedIndirect
will fire multiple observers:Since components uses bindings, I cannot just convert them into
Ember.computed.alias
.The text was updated successfully, but these errors were encountered: