Skip to content

Commit 4a6c858

Browse files
author
Peter Hulst
committed
added async/await example
1 parent c17c22c commit 4a6c858

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ your changes have been persisted.
100100
client.set('fleet', 'truck1', [33.5123, -112.2693]).then(() => {
101101
console.log('your changes have been persisted');
102102
});
103+
```
104+
105+
You may, of course, prefer to use async/await instead of Promises, like so:
103106

107+
```javascript
108+
let data = await client.getPoint('fleet', 'truck2');
109+
console.log(`truck2 is at ${data.point.lat},${data.point.lon}`);
104110
```
105111

106112
# Command examples

0 commit comments

Comments
 (0)