Skip to content

Ability to observe multiple properties #1

@YohDeadfall

Description

@YohDeadfall

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions