Skip to content

Instantly share code, notes, and snippets.

@justsml
Last active December 21, 2022 06:16
Show Gist options
  • Save justsml/6ad9e37a96ad1f3a75ca509038510a5b to your computer and use it in GitHub Desktop.
Save justsml/6ad9e37a96ad1f3a75ca509038510a5b to your computer and use it in GitHub Desktop.
// OPTION #1: no temp streamProcessor var
fetch(...)
.then(progressHelper(console.log))
// ⚠️ OR️ ️⚠️
// OPTION #2: define a `streamProcessor` to hold our console logger
const streamProcessor = progressHelper(console.log)
fetch(...)
.then(streamProcessor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment