Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Adds call to progress bar function #179

Merged
merged 6 commits into from
Sep 5, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ module.exports = function (createChunker, ipldResolver, createReducer, _options)
pull(
file.content,
createChunker(options.chunkerOptions),
pull.map(chunk => new Buffer(chunk)),
pull.map(chunk => {
if (options.progress) options.progress(chunk.byteLength)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check that it is also a function

return new Buffer(chunk)
}),
pull.map(buffer => new UnixFS('file', buffer)),
pull.asyncMap((fileNode, callback) => {
DAGNode.create(fileNode.marshal(), (err, node) => {
Expand Down