Skip to content

Commit 7337107

Browse files
authored
Merge pull request #635 from aikar/patch-1
Cleanup ES7 example
2 parents cad7820 + f49a1a9 commit 7337107

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"prettier"
44
],
55
"parserOptions": {
6-
"ecmaVersion": 7,
6+
"ecmaVersion": 2017,
77
},
88
"plugins": [
99
"markdown",

documentation/Promise-Wrapper.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,21 @@ In addition to errback interface there is thin wrapper to expose Promise-based a
2727
```
2828
## ES7 Async Await
2929
```js
30-
/*
31-
async function main () {
30+
async function example1 () {
3231
const mysql = require('mysql2/promise');
3332
const conn = await mysql.createConnection({ database: test });
3433
let [rows, fields] = await conn.execute('select ?+? as sum', [2, 2]);
3534
}
36-
*/
37-
```
3835

39-
```js
40-
// eslint-disable-next-block
41-
/*
36+
async function example2 () {
4237
let mysql = require('mysql2/promise');
4338
let pool = mysql.createPool({database: test});
4439
// execute in parallel, next console.log in 3 seconds
4540
await Promise.all([pool.query('select sleep(2)'), pool.query('select sleep(3)')]);
4641
console.log('3 seconds after');
4742
await pool.end();
4843
await conn.end();
49-
*/
44+
}
5045
```
5146

5247
## With [CO](https://github.com/tj/co)

0 commit comments

Comments
 (0)