mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-20 12:36:31 +00:00
fix: make subscribe comply with ipfs interface (#389)
BREAKING CHANGE: The ipfs interface specified that options should be provided after the handler, not before. https://github.com/ipfs/interface-js-ipfs-core/blob/v0.109.0/SPEC/PUBSUB.md#pubsubsubscribe This corrects the order of parameters. See the jsdocs examples for subscribe to see how it should be used.
This commit is contained in:
@ -72,7 +72,7 @@ describe('.pubsub', () => {
|
||||
cb(err)
|
||||
}),
|
||||
// subscribe on the first
|
||||
(cb) => nodes[0].pubsub.subscribe('pubsub', handler, cb),
|
||||
(cb) => nodes[0].pubsub.subscribe('pubsub', handler, null, cb),
|
||||
// Wait a moment before publishing
|
||||
(cb) => setTimeout(cb, 500),
|
||||
// publish on the second
|
||||
@ -110,7 +110,7 @@ describe('.pubsub', () => {
|
||||
cb(err)
|
||||
}),
|
||||
// subscribe on the first
|
||||
(cb) => nodes[0].pubsub.subscribe('pubsub', handler, cb),
|
||||
(cb) => nodes[0].pubsub.subscribe('pubsub', handler, {}, cb),
|
||||
// Wait a moment before publishing
|
||||
(cb) => setTimeout(cb, 500),
|
||||
// publish on the second
|
||||
|
Reference in New Issue
Block a user