Skip to content

Commit 6482a8c

Browse files
authored
Merge pull request #525 from JKRhb/apostrophe-replacement
Use simple single and double quotes in code examples
2 parents 521e7d1 + 08f31d7 commit 6482a8c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,7 +2400,7 @@

ConsumedThing Examples

24002400
};
24012401

24022402
try {
2403-
// subscribe to property change for temperature
2403+
// subscribe to property change for "temperature"
24042404
await thing.observeProperty("temperature", async (data) => {
24052405
try {
24062406
console.log("Temperature changed to: " + await data.value());
@@ -2409,11 +2409,11 @@

ConsumedThing Examples

24092409
console.error(error);
24102410
}
24112411
});
2412-
// subscribe to the ready event defined in the TD
2412+
// subscribe to the "ready" event defined in the TD
24132413
await thing.subscribeEvent("ready", async (eventData) => {
24142414
try {
24152415
console.log("Ready; index: " + await eventData.value());
2416-
// run the startMeasurement action defined by TD
2416+
// run the "startMeasurement" action defined by TD
24172417
await thing.invokeAction("startMeasurement", { units: "Celsius" });
24182418
console.log("Measurement started.");
24192419
} catch (error) {
@@ -2432,7 +2432,7 @@

ConsumedThing Examples

24322432
console.log("Temperature: " + temperature);
24332433

24342434
await thing.unsubscribe("ready");
2435-
console.log("Unsubscribed from the ready event.");
2435+
console.log("Unsubscribed from the 'ready' event.");
24362436
} catch (error) {
24372437
console.log("Error in the cleanup function");
24382438
}
@@ -2457,7 +2457,7 @@

ConsumedThing Examples

24572457
let response;
24582458
let image;
24592459
try {
2460-
response = await thing.invokeAction(takePicture”));
2460+
response = await thing.invokeAction("takePicture");
24612461
image = await response.value() // throws NotReadableError --> schema not defined
24622462
} catch(ex) {
24632463
image = await response.arrayBuffer();
@@ -2519,7 +2519,7 @@

ConsumedThing Examples

25192519
parser.on('data', data => data.name === 'startObject' && ++objectCounter);
25202520
parser.on('end', () => console.log(`Found ${objectCounter} objects.`));
25212521

2522-
const response = await thing.readProperty(eventHistory)
2522+
const response = await thing.readProperty("eventHistory")
25232523
await response.data.pipeTo(parser);
25242524

25252525
// Found N objects
@@ -4237,7 +4237,7 @@

API design rationale

42374237
and the <code>open()code> method are directly exposed on the object.
42384238
p>
42394239
<pre class="example" title="Open a lock with a simple API">
4240-
let lock = await WoT.consume(https://td.my.com/lock-00123);
4240+
let lock = await WoT.consume('https://td.my.com/lock-00123');
42414241
console.log(lock.status);
42424242
lock.open('withThisKey');
42434243
pre>
@@ -4262,8 +4262,8 @@

API design rationale

42624262
let res = await fetch(‘https://td.my.com/lock-00123’);
42634263
let td = await res.json();
42644264
let lock = new ConsumedThing(td);
4265-
console.log(lock.readProperty(status));
4266-
lock.invokeAction(open, 'withThisKey');
4265+
console.log(lock.readProperty('status'));
4266+
lock.invokeAction('open', 'withThisKey');
42674267
pre>
42684268
section>
42694269
<p>

0 commit comments

Comments
 (0)