Skip to content

Commit

Permalink
18-fetch-after-record
Browse files Browse the repository at this point in the history
  • Loading branch information
john-smilga committed Jun 19, 2021
1 parent 28a723e commit c5829e5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions 18-fetch/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ const url = 'https://www.course-api.com/react-tours-project'
// console.log(fetch(url))

// fetch(url)
// .then((response) => response.json())
// .then((resp) => resp.json())
// .then((data) => console.log(data))
// .catch((err) => console.log(err))

const getTours = async () => {
try {
const response = await fetch(url)
const data = await response.json()
console.log(data)
const resp = await fetch(url)

return resp.json()
// console.log(data)
} catch (error) {
console.log(error)
}
}

console.log(getTours())
console.log(getTours().then())

0 comments on commit c5829e5

Please sign in to comment.