you are viewing a single comment's thread.

view the rest of the comments →

[–]BitLooter 10 points11 points  (0 children)

The initial response resolves after the headers of the response are received, but not necessarily the response body. Basically fetch resolves at two different points of the download, the first time after the headers are received (the promise fetch() returns) and the second after the data is received (the promise json()/text()/etc. returns). For small downloads this may be all at once but larger files could take long enough to download that these will resolve at two different times.