This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const parseLine = (line) => { | |
try { | |
return JSON.parse(line); | |
} catch (e) { | |
} | |
}; | |
const ucasefirst = (str) => str.charAt(0).toUpperCase() + str.slice(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chunkedUrl = 'https://jigsaw.w3.org/HTTP/ChunkedScript'; | |
fetch(chunkedUrl) | |
.then(processChunkedResponse) | |
.then(onChunkedResponseComplete) | |
.catch(onChunkedResponseError) | |
; | |
function onChunkedResponseComplete(result) { | |
console.log('all done!', result) | |
} |