-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web_basicの内容を追加 #129
web_basicの内容を追加 #129
Conversation
const res = await fetch("{あなたのURL}/json", { method: "GET" }) | ||
const data = await res.json() | ||
// 受け取ったdataをHTMLにセットする処理 | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここらへん、thenを使うことにしてたはず。去年の話ではあるけど
https://q.trap.jp/messages/728565e0-3ed3-4644-b949-c613a6e5ec3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thenの方が直感的、ほんまか?と言う気が若干
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
まあ、単語としてはthenの方がわかりやすいとは思う。awaitはともかく、asyncはなんで付けるのかよくわからんみたいになることもありそうだし。
とはいえ俺も別にどっちてもいいとは思うし、変えてもいいと思ってる。
一応去年こんな感じのやり取りがあったってだけ共有
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
初学者にPromiseの概念は難しすぎると考えて上のような結論に至ってます
おまじない避けたいと言うのもある
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
しかもこれ01ということを考えるとasync/awaitを持ってくるには早すぎる気がする(でもfetchは必要だし…)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.