1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00

add async await example

This commit is contained in:
Liran
2017-11-08 10:51:15 +02:00
committed by Ruben Bridgewater
parent 1ef099c790
commit 80f6960fb5

View File

@@ -70,6 +70,12 @@ now *getAsync* is a promisified version of *client.get*:
return getAsync('foo').then(function(res) {
console.log(res); // => 'bar'
});
// or using [async await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)
async myFunc() {
const res = await getAsync('foo');
console.log(res);
}
```
#### Bluebird Promises