If you bind both properties and change prop, they both resolve with a new value:
obs.listenTo("count", ({ value }) => {
console.log(`count changed to ${value}`);
});
obs.listenTo("counter", ({ value }) => {
console.log(`counter changed to ${value}`);
});
obs.prop = "Hi"; // -> "count changed to 1"
// "counter changed to Hi"
If you then make both properties unbound and then read them, the property calling resolve will be reset, but the property that doesn't call resolve will retain its old value:
There is a strange asymmetry between
value
behaviors that callresolve
and ones that don't when the properties are unbound.Take this example:
If you bind both properties and change
prop
, they bothresolve
with a new value:If you then make both properties unbound and then read them, the property calling
resolve
will be reset, but the property that doesn't callresolve
will retain its old value: