awaitipfs.pubsub.subscribe(topic, receiveMsg) console.log(`subscribed to ${topic}`)
awaitipfs.pubsub.unsubscribe(topic, receiveMsg) console.log(`unsubscribed from ${topic}`)
// Or removing all listeners:
consttopic = 'fruit-of-the-day' constreceiveMsg = (msg) =>console.log(msg.toString()) awaitipfs.pubsub.subscribe(topic, receiveMsg); // Will unsubscribe ALL handlers for the given topic awaitipfs.pubsub.unsubscribe(topic);
Returns the list of subscriptions the peer is subscribed to