-
Notifications
You must be signed in to change notification settings - Fork 1.2k
pubsub.subscribe option parameter not optional in 0.27 #1129
Comments
@kevinsimper Wanna submit a test that shows that incorrect behavior? |
If two arguments are passed, So if there are two args it should be ok as it'll just result in a promise being returned from the function call, which is what happens in this test case. @kevinsimper have you observed any unexpected behaviour? |
@diasdavid Sorry for the missing response! It has been fixed in the newest version of ipfs https://jsbin.com/zuvuxijuma/edit?html,js,output
This will fail:
with this error:
However works fine now with:
|
👍 great, thanks for letting us know @kevinsimper |
According to the docs, option is optional, but it is required in 0.27 as it will try to call the callback as the third parameter.
https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/PUBSUB.md#pubsubsubscribe
If only two parameters were given, both callback and handler would be undefined
js-ipfs/src/core/components/pubsub.js
Line 16 in bd264f2
The text was updated successfully, but these errors were encountered: