Like the title says. Is there a way to modify a observed valued without triggering the observer callback in Polymer?
For example
Polymer({
is: 'my-component',
properties: {
aValue: {
type: Number,
value: 0,
observer: '_valueChanged',
notify: true
},
ref: {
type: Object,
computed: '_computeRef(channel, channelNumber)'
}
},
_computeRef: function(channel, channelNumber) {
var ref = new Firebase("/*link*/");
ref.on("child_changed", function(data) {
this.aValue.setWithoutCallingObserver(data.val());
}.bind(this));
return ref;
},
_valueChanged: function() {
var message = { aValue: this.aValue };
if (this.ref) {
this.ref.set(message);
}
}
});
This would be useful because now I am experiencing lag in the following scenario:
- Adapting
aValue
in a third party app - Firebase updates all clients
- The .on callback sets the value and triggers the observer callback
- Causes a .set to firebase
- go back to 2.
Update: The issue is not firebase related. I believe the solution is in getting control over how updates are applied to observed values in Polymer. Partly because changes to the values in the firebase store can be made by 3th party (not necessarily web) applications too.