-
Notifications
You must be signed in to change notification settings - Fork 109
Conversation
@@ -66,7 +67,7 @@ A valid (read: that follows this interface) IPFS core implementation, must expos | |||
|
|||
`callback` must follow `function (err, node) {}` signature, where `err` is an error if the operation was not successful and `node` is a MerkleDAG node of the type [DAGNode][] | |||
|
|||
If no `callback` is passed, a promise is returned. | |||
Returns a [promise][]. |
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.
This change is not correct. The promise is only returned if no callback
is passed.
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.
Alas! I thought so too, but tried this with promisify-es6
-- it returns a promise regardless.
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.
Interesting. Not sure if we want this though, I guess we have to fork it and make our own version in the long run.
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.
@dignifiedquire I think I agree about it being undesirable to always return a promise. A counterargument though might be that lots of people are already depending on promisify and us deviating from "the norm" may be detrimental to the larger community. Hm--I'm not sure. ping @diasdavid @nginnever too :)
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 would rather for it to be one or the other. Why can't we reach out to the dev of promisify-es6 and understand the reason behind his decision? Seems like the dev might have expected that if someone passes a callback, to not grab the promise as well, there would be nothing good coming from that.
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.
Nevertheless, as for the spec. Let's rephrase to:
A promise is also returned, you can skip passing the callback to the function.
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.
+1 for reaching out to the dev first -- this is how open source works best!
I'm liking the aggressive linking you're doing recently. +1. |
@RichardLitt man, ever since I learned about markdown footnote links they've soo become my jam ❤️ |
I reverted the phrasing back to how it was before for promises, but linkified them. |
thank you @noffle :) |
s/interface-stream-muxer/interface-ipfs-core, and a couple of other small tweaks.