-
Notifications
You must be signed in to change notification settings - Fork 1.2k
updated cat core to return just file stream #253
Conversation
@@ -45,7 +45,9 @@ module.exports = function files (self) { | |||
callback('This dag node is a directory', null) | |||
} else { | |||
const exportStream = Exporter(hash, self._dagS) | |||
callback(null, exportStream) | |||
exportStream.on('data', (object) => { |
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.
s/on/once, so that the listener is cleared after
Missing
|
This needs PR merge for this to pass tests. |
|
||
module.exports = function files (self) { | ||
return { | ||
add: (arr, callback) => { | ||
add: promisify((arr, cb) => { |
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.
our pattern is to use callback
as the most top level callback, so that it is easy distinguishable when we jump out the func
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.
that's just @diasdavid s pattern 😛
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.
haha to callback or cb, i'll switch back to callback here
Closing in favor of PR |
This came from conversation over the interface-core cat api talks PR.
This changes the core files cat command to return just the stream part of the unixfs-engine.exporter
This also updates the cat cli, http-api, and tests to respect the change.