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

export is now a readable object stream #42

Merged
merged 1 commit into from
May 21, 2016
Merged

Conversation

nginnever
Copy link
Contributor

cc @diasdavid @dignifiedquire could use a look at this :D

function Exporter (hash, dagService, options) {
Readable.call(this, { objectMode: true })

if (!(this instanceof Exporter)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You might be leaking memory in a weird way if this check doesn't come before the Readable.call(...) line.


function fileExporter (node, name, dir, callback) {
this.fileExporter = (node, name, dir, callback) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why this function news to be exposed on the instantiated Object?

@daviddias
Copy link
Contributor

CR'ed :)

const ds = new DAGService(bs)
const testExport = exporter(hash, ds)
testExport.on('error', (err) => {
expect(err).to.exist
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we check that it's the error we're expecting?

@hackergrrl
Copy link
Contributor

One comment, but otherwise 🐴 LGTM

@@ -78,5 +87,16 @@ module.exports = function (repo) {
done()
}, 1000)
})

it('expect a dag service error over stream', (done) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

s/'expect a dag service error over stream'/'fails on non existent hash'

@daviddias
Copy link
Contributor

@nginnever squash the 'updates commit' and update the README, then we are all set :)

@daviddias
Copy link
Contributor

Awesome! :D

@daviddias daviddias merged commit 1fe5848 into master May 21, 2016
@daviddias daviddias deleted the exporter/duplex branch May 21, 2016 09:15
@hackergrrl
Copy link
Contributor

Niiice

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants