There should be a method on the KineticObject to make a combined observable with a special property - in case of notification suspension it should trigger only one and not for each observed property.
API:
class KineticObject
{
public IObservable<T1, T2> WhenAny(
KineticReadOnlyProperty<T1> property1,
KineticReadOnlyProperty<T2> property2);
// etc.
}
Usage:
var obj = new KineticExample();
using (obj.SuppressChanges())
{
obj.WhenAny(obj.Number, obj.Text)
.Subscribe((n, t) => Assert.Equal(2, n));
obj.Number.Set(2);
obj.Text.Set("b");
}
// The assertion should pass
Problems:
- As the example demonstrates, a reference to the object should be specified which makes the proposed API error prone. Therefore, it makes sense to support versioning, so any observable internally will have a reference to the source which already contains a version.
There should be a method on the
KineticObjectto make a combined observable with a special property - in case of notification suspension it should trigger only one and not for each observed property.API:
Usage:
Problems: