Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function* asapInOrderRequests(urls) {
- const requests = urls.map((url) => fetch(url))
- for await (const response of requests) {
- const text = await response.text()
- yield text
- }
- }
- async function pageText(urls) {
- for await (const responseText of asapInOrderRequests(urls)) {
- console.log(responseText)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement