Skip to content

Commit 504d45e

Browse files
fterdalglebec
authored andcommitted
docs(seed): remove outdated async-await comments (#123)
`async-await` has been blessed by the Almighty Curriculum, and no longer needs to be treated as something new and strange to students.
1 parent bb9f3d9 commit 504d45e

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

script/seed.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,15 @@
33
const db = require('../server/db')
44
const {User} = require('../server/db/models')
55

6-
/**
7-
* Welcome to the seed file! This seed file uses a newer language feature called...
8-
*
9-
* -=-= ASYNC...AWAIT -=-=
10-
*
11-
* Async-await is a joy to use! Read more about it in the MDN docs:
12-
*
13-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
14-
*
15-
* Now that you've got the main idea, check it out in practice below!
16-
*/
17-
186
async function seed() {
197
await db.sync({force: true})
208
console.log('db synced!')
21-
// Whoa! Because we `await` the promise that db.sync returns, the next line will not be
22-
// executed until that promise resolves!
9+
2310
const users = await Promise.all([
2411
User.create({email: '[email protected]', password: '123'}),
2512
User.create({email: '[email protected]', password: '123'})
2613
])
27-
// Wowzers! We can even `await` on the right-hand side of the assignment operator
28-
// and store the result that the promise resolves to in a variable! This is nice!
14+
2915
console.log(`seeded ${users.length} users`)
3016
console.log(`seeded successfully`)
3117
}

0 commit comments

Comments
 (0)