Instantly share code, notes, and snippets.

Embed
What would you like to do?
fetch examples:
// The progressHelper could be inline w/ .then() below...
const streamProcessor = progressHelper(console.log)
fetch('https://fetch-progress.anthum.com/20kbps/images/sunrise-progressive.jpg')
.then(streamProcessor) // note: NO parentheses because `.then` needs to get a function
.then(response => response.blob())
.then(blobData => {
// ... set as base64 on an <img src="base64...">
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment