How to use the @node-wot/core.TDResourceListener function in @node-wot/core

To help you get started, we’ve selected a few @node-wot/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse / thingweb.node-wot / packages / binding-coap / src / coap-server.ts View on Github external
let path = "/" + encodeURIComponent(name) + "/properties/" + encodeURIComponent(propertyName);
        let listener = new PropertyResourceListener(thing, propertyName);
        this.addResource(path, listener);
      }
      for (let actionName in thing.actions) {
        let path = "/" + encodeURIComponent(name) + "/actions/" + encodeURIComponent(actionName);
        let listener = new ActionResourceListener(thing, actionName);
        this.addResource(path, listener);
      }
      for (let eventName in thing.events) {
        let path = "/" + encodeURIComponent(name) + "/events/" + encodeURIComponent(eventName);
        let listener = new EventResourceListener(eventName, thing.events[eventName].getState().subject);
        this.addResource(path, listener);
      }

      this.addResource("/" + encodeURIComponent(name), new TDResourceListener(thing));

      resolve();
    });
  }