-
Notifications
You must be signed in to change notification settings - Fork 300
ipfs.files.add: cb is not a function #308
Comments
Hello chpio! Thanks for pointing this out. Could you describe a test case when this error is thrown? Or what you are trying to add. I believe that promise should reject an error there when you provide add with invalid input. We have a test case here in interface-ipfs-core that tests https://github.com/ipfs/interface-ipfs-core/blob/master/src/files.js#L138 |
https://github.com/ipfs/js-ipfs-api/blob/master/src/api/add.js#L18 this code can only work with a cb if Promises are used there is no cb passed in. |
Fixed on #309. reopen as necessary |
cb is not a function, not add |
offtopic: wouldn't it be better to have one basic implementation (only using callbacks) and a small wrapper for promises (requirable through |
Could you elaborate on what 'better' would mean? Our current API comes from a consensus after many discussions and several people involved, but of course, we are always open to things to make things better :) |
ok... my perspective is better = simper (in this case) edit: simplicity is not a thing in js-ipfs-api anyway ;) |
It doesn't have to be complex :), in fact, we are working towards making the code simpler and the API well documented, see: |
adding is not working any more in the new version (6.0.3). 6.0.2 is working. |
i thought it's a broken Promise implementation in node v4 but it's not ;( |
Can confirm this, I can't return a promise from
|
uhh i see now...
|
Yep, the problem is that the |
using _Promise_s
The text was updated successfully, but these errors were encountered: