Тёмный
Tom on the Internet
Tom on the Internet
Tom on the Internet
Подписаться
I'm Tom a software developer from St. Catharines Ontario Canada.

I make videos about technology and the internet.

tomontheinternet.com
re: your comment on my pull request
1:01
3 месяца назад
Moving an image between browser windows
11:55
3 месяца назад
How I Code in 2024
11:00
3 месяца назад
My best terminal game yet - Cemetery Escape
9:41
10 месяцев назад
Ugly user model
4:08
Год назад
Hunt down changes with git log
4:25
Год назад
I like bad code
7:58
2 года назад
My website knows where you live
3:36
2 года назад
Gatsby was a bad choice (for me)
8:06
2 года назад
Комментарии
@thiagof414
@thiagof414 9 часов назад
Thank you!
@SENPAY98K
@SENPAY98K 9 часов назад
@tomontheinternet Which editor is that you using ?
@tomontheinternet
@tomontheinternet 8 часов назад
Neovim!
@SENPAY98K
@SENPAY98K 4 часа назад
@@tomontheinternet thanks
@johnpeypool
@johnpeypool 9 часов назад
Good explanation 👍
@BitYoungjae
@BitYoungjae 10 часов назад
Why are the words ‘텀’ filling up the background?
@BitYoungjae
@BitYoungjae 10 часов назад
Oh, now I see, your name is ‘Tom’ ㅋㅋㅋ
@alifrahman7099
@alifrahman7099 20 часов назад
this random video is so goated wtf
@PauxloE
@PauxloE День назад
I think what is missing here might be a proper alternative to parse the JSON in a streaming way.
@PerriPaprikash
@PerriPaprikash День назад
aren't you sending it 2 bytes at a time?
@homesynthesis
@homesynthesis День назад
For await feels incredibly cursed but I'm glad I now know about it and can't wait to use it as much as humanly possible
@kaigao-dev
@kaigao-dev День назад
Great info, thank you!
@hellotherenameishere
@hellotherenameishere День назад
Haha that ending is so self-aware, easy sub 👍
@yosvelquintero
@yosvelquintero 2 дня назад
You can create a reusable method that handles the fetching and JSON parsing in one line. Here’s an example: ``` const fetchJson = async (url) => (await fetch(url)).json(); ``` Then: ``` const result = await fetchJson('/api/endpoint/json'); ```
@DrogaProgramisty
@DrogaProgramisty 2 дня назад
Very good video!!
@julien.roques
@julien.roques 2 дня назад
You should remove that background music, your video would be even better.
@hderwynDev
@hderwynDev 2 дня назад
this is some kind of advance stuff my man
@sunnyyeung3733
@sunnyyeung3733 2 дня назад
await http response, and then await body, done.
@Fullflexno
@Fullflexno 2 дня назад
Cool video!
@Mari_Selalu_Berbuat_Kebaikan
@Mari_Selalu_Berbuat_Kebaikan 2 дня назад
Let's always do alot of good ❤ Nam myoho renge kyo
@kael7953
@kael7953 2 дня назад
Because it’s a cancerous language that’s why.
@modernkennnern
@modernkennnern 2 дня назад
Mildly annoys me that they call it argument when it's actually the parameters 😅
@jamashe
@jamashe 2 дня назад
Could you share you neovim config? It looks pretty nice. And thanks.
@quinndirks5653
@quinndirks5653 2 дня назад
Great video! I have been doing javascript for awhile, but this is the first time I've seen someone show an example of streaming data in from a fetch request... I didn't even know it was possible. Very cool!
@realderek
@realderek 2 дня назад
Great explanation. Seems very obvious now but I wasn’t thinking about the headers and body not coming in at the same time.
@bige2899
@bige2899 3 дня назад
I love this kind of videos, great explanation
@VincentDECAUX
@VincentDECAUX 3 дня назад
The question, why not ? It's so logical to wait for the body, then to parse it. I can't understand why it shouldn't be awaited..
@TENNISMANIAC144
@TENNISMANIAC144 3 дня назад
Thank you! Fwiw, I bailed on the video early because as soon as you explained it high level I completely got it, but commenting to hopefully balance out not watching the whole video's impact on performance.
@aaronevans7713
@aaronevans7713 3 дня назад
What is the justification for returning the headers synchronously? Why not resolve fetch as soon as the status line returns?
@crim-son
@crim-son 3 дня назад
But then why does axios require only one await
@metric152
@metric152 3 дня назад
This was interesting. I thought it was for a parsing fail.
@bob_kazamakis
@bob_kazamakis 3 дня назад
Better question is why you need let on constant data 🤔
@gavravdhongadi9824
@gavravdhongadi9824 3 дня назад
Just couple of days back. I asked my lead about need of response.json() and I could not get the clear answer and you have provided a clear explanation. Thank you.
@krellin
@krellin 3 дня назад
long story short its because javascript devs are doing low latency software now and they cant wait for the full response they start doing important shit as soon as they retrieve headers :) cute
@danel1922
@danel1922 3 дня назад
brilliant, subscribed
@AndrewFloatrx
@AndrewFloatrx 3 дня назад
await fetch().then(r=>r.json());
@user-pw5do6tu7i
@user-pw5do6tu7i 3 дня назад
who tf has ever seen "for await" before??? seems really useful but ive never seen it before
@wayneandrerochareis5897
@wayneandrerochareis5897 3 дня назад
loved the explanation
@nimitsavant3127
@nimitsavant3127 3 дня назад
amazing video 🥑 What are you using to record this?
@kavinkumar
@kavinkumar 3 дня назад
Hi dude nice video , is there any way to mark the end of stream , like how to know the data transfer is complete.
@cook5436
@cook5436 4 дня назад
Tell me you made the server side slow streaming code with chatgpt
@ComfyCosi
@ComfyCosi 4 дня назад
Is this how chatgpt streams in text?
@MichaelChanCY
@MichaelChanCY 4 дня назад
Wow! Your demonstration is perfect! Great work!
@EvestDev
@EvestDev 4 дня назад
I love your videos so much XD
@dopetag
@dopetag 4 дня назад
This is pure gold.
@catalinmarianmursa7892
@catalinmarianmursa7892 4 дня назад
nice thanks!
@utubetvux5170
@utubetvux5170 4 дня назад
axios for the winner
@nested9301
@nested9301 4 дня назад
it' twice because the language is a** that 's why
@mohammedmukadasmaltitiabub6840
a very interesting and educative video, thanks man
@Ace-fkubar
@Ace-fkubar 4 дня назад
DON'T ATTACK ... AWAIT ... HE'S NOT A BAD MAN I PROMISE
@aryankathawale9269
@aryankathawale9269 4 дня назад
damn that was amazing . not only i understood i also got how to stream and how chat gpt works
@JonLynchIsAlive
@JonLynchIsAlive 4 дня назад
This is actually a great explanation of the need for the second promise. This made me think of the fact that some developers will make a "HEAD" request to see if a resource is available. But it could just be done with that initial response using headers alone.
@jpisello
@jpisello 2 дня назад
Using the HEAD request will be more efficient for the server, though, since it won't actually send the body (contents) of the requested URI. (Also, the requester _does_ actually get the content in a GET/POST request-whether your code reads it or not.) So altogether, if you just need to know whether a resource exists, use HEAD.
@JonLynchIsAlive
@JonLynchIsAlive 2 дня назад
@@jpisello true!
@filipesommer8253
@filipesommer8253 4 дня назад
Very interesting. I wonder if they're would be a way to only need one await if we knew the response was a non-streaming request?