Skip to content

API improvements #78

@zolkis

Description

@zolkis

This issue is for discussing API improvements.

Let's start the discussion on observing functionality on the ConsumedThing interface.

There we have

Observable observe(DOMString name, RequestType requestType);

enum RequestType {  "property", "action", "event", "td" };

It allows subscribing and unsubscribing to notifications like:

  • property change made by others
  • action invoked by others
  • any event supported by the target Thing
  • changes to the Thing Description (TD) of the Thing.

Note that these could be also modeled with default events on ExposedThing, one being dedicated to 'descriptionchange', one for 'propertychange', one for 'actioninvocation' and then the signature would change to:

Observable observe(DOMString eventName);

but the functionality would be implicit.

I wonder which would be more developer-friendly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions