orbit-db-pubsub
Advanced tools
Comparing version 0.5.6 to 0.5.7
{ | ||
"name": "orbit-db-pubsub", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"description": "Message propagation module for orbit-db", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,5 +30,5 @@ 'use strict' | ||
async subscribe(topic, onMessageCallback, onNewPeerCallback) { | ||
async subscribe(topic, onMessageCallback, onNewPeerCallback, options = {}) { | ||
if(!this._subscriptions[topic] && this._ipfs.pubsub) { | ||
await this._ipfs.pubsub.subscribe(topic, this._handleMessage) | ||
await this._ipfs.pubsub.subscribe(topic, this._handleMessage, options) | ||
@@ -73,5 +73,5 @@ const topicMonitor = new PeerMonitor(this._ipfs.pubsub, topic) | ||
publish(topic, message) { | ||
publish(topic, message, options = {}) { | ||
if(this._subscriptions[topic] && this._ipfs.pubsub) { | ||
this._ipfs.pubsub.publish(topic, Buffer.from(JSON.stringify(message))) | ||
this._ipfs.pubsub.publish(topic, Buffer.from(JSON.stringify(message)), options) | ||
} | ||
@@ -78,0 +78,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
10931
0