-
Notifications
You must be signed in to change notification settings - Fork 298
refactor: replace wreck with raw request #414
Conversation
expect(result.length).to.equal(1) | ||
done() | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice :)
function parseRaw (res, cb) { | ||
res | ||
.once('error', cb) | ||
.pipe(concat((data) => cb(null, data))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use bl
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because concat does the right thing for streams, arrays and buffers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :) Will remind me of that the next time I need to do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Does this mean that browserify is now golden?
}) | ||
}) | ||
} | ||
|
||
function display (hash) { | ||
ipfs.cat(hash, function (err, res) { | ||
ipfs.cat(hash, {buffer: true}, function (err, res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs to be buffered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think this buffer: true
is one of the most misleading features. Can you add a comment that says:
"Buffer the whole response instead of streaming it"
@@ -4,15 +4,13 @@ | |||
"description": "", | |||
"main": "index.js", | |||
"scripts": { | |||
"start": "browserify -t brfs index.js > bundle.js && http-server -a 127.0.0.1 -p 8888" | |||
"start": "browserify index.js > bundle.js && http-server -a 127.0.0.1 -p 8888" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
btw, you missed the chance of calling this brach 'reeeeekt!' ahah :D |
No description provided.