Skip to content

Commit 46aad78

Browse files
Simon Prickettleibale
Simon Prickett
andauthored
Updated examples to use named functions. (#1687)
* Updated examples to user named functions. * Update README.md Co-authored-by: Leibale Eidelman <leibale1998@gmail.com>
1 parent a5eb165 commit 46aad78

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

examples/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
This folder contains example scripts showing how to use Node Redis in different scenarios.
44

5-
|File Name |Description |
6-
|------------------------|------------------------------------|
7-
|`connect-as-acl-user.js`|Connect to Redis 6 using an ACL user|
5+
| File Name | Description |
6+
|--------------------------|--------------------------------------|
7+
| `connect-as-acl-user.js` | Connect to Redis 6 using an ACL user |
88

99
## Contributing
1010

@@ -45,7 +45,7 @@ Here's a starter template for adding a new example, imagine this is stored in `d
4545

4646
import { createClient } from 'redis';
4747

48-
const doSomething = async () => {
48+
async function doSomething() {
4949
const client = createClient();
5050

5151
await client.connect();
@@ -55,6 +55,5 @@ const doSomething = async () => {
5555
await client.quit();
5656
}
5757

58-
5958
doSomething();
60-
```
59+
```

examples/connect-as-acl-user.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { createClient } from 'redis';
99

10-
const connectWithACLUser = async () => {
10+
async function connectWithACLUser() {
1111
const client = createClient({
1212
url: 'redis://testuser:testpassword@127.0.0.1:6379'
1313
});
@@ -27,6 +27,4 @@ const connectWithACLUser = async () => {
2727
await client.quit();
2828
}
2929

30-
3130
connectWithACLUser();
32-

0 commit comments

Comments
 (0)