Last active
December 14, 2018 18:32
-
-
Save justsml/db5ccc55ffb93c75e04e014d1f553cfb to your computer and use it in GitHub Desktop.
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 progressHelper = require('./progressHelper.js') | |
const handler = ({loaded, total}) => { | |
console.log(`Downloaded ${loaded} of ${total}`) | |
} | |
// handler args: ({ loaded = Kb, total = 0-100% }) | |
const streamProcessor = progressHelper(handler) | |
// => streamProcessor is a function for use with the response _stream_ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment