Skip to content

Commit 1c25291

Browse files
committed
progress commit
1 parent dfda633 commit 1c25291

5 files changed

Lines changed: 20 additions & 19 deletions

File tree

lessons/03-request-response/lecture/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// import z from 'zod'
22
// import { fakeFetch } from './utils'
33

4-
const API = 'http://localhost:3333'
5-
// const API = 'http://swapi.dev/api'
4+
// const API = 'http://localhost:3333'
5+
const API = 'http://swapi.dev/api'
66

77
/****************************************
88
Part 1: Request

lessons/04-async-await/lecture/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// import { User, createAccount, addAccountUser } from './users'
22

3-
const API = 'http://localhost:3333'
4-
// const API = 'http://swapi.dev/api'
3+
// const API = 'http://localhost:3333'
4+
const API = 'http://swapi.dev/api'
55

66
/****************************************
77
Part 1

lessons/04-async-await/practice/index.final.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const API = 'http://localhost:3333'
2-
// const API = 'http://swapi.dev/api'
1+
// const API = 'http://localhost:3333'
2+
const API = 'http://swapi.dev/api'
33

44
// Each practice below implements a main() function
55
main()

lessons/04-async-await/practice/index.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const API = 'http://localhost:3333'
2-
// const API = 'http://swapi.dev/api'
1+
// const API = 'http://localhost:3333'
2+
const API = 'http://swapi.dev/api'
33

44
// Each practice below implements a main() function
55
main()
@@ -8,19 +8,19 @@ main()
88
Practice: 1
99
*****************************************/
1010

11-
// function wait(ms: number) {
12-
// return new Promise((resolve) => {
13-
// setTimeout(resolve, ms)
14-
// })
15-
// }
11+
function wait(ms: number) {
12+
return new Promise((resolve) => {
13+
setTimeout(resolve, ms)
14+
})
15+
}
1616

17-
// // Re-write main to use async/await
17+
// Re-write main to use async/await
1818

19-
// function main() {
20-
// wait(1000).then(() => {
21-
// console.log('Wait for one second')
22-
// })
23-
// }
19+
function main() {
20+
wait(1000).then(() => {
21+
console.log('Wait for one second')
22+
})
23+
}
2424

2525
/****************************************
2626
Practice: 2

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"strict": true,
44
"module": "commonjs",
55
// "module": "esnext",
6+
"moduleDetection": "force",
67
"esModuleInterop": true,
78
"jsx": "react",
89
"target": "ES2020",

0 commit comments

Comments
 (0)