@dxos/broadcast
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -233,3 +233,3 @@ "use strict"; | ||
* @param {Buffer} packetEncoded | ||
* @returns {boolean} Returns true if the decoding was successful. | ||
* @returns {(Packet|undefined)} Returns the packet if the decoding was successful. | ||
*/ | ||
@@ -257,6 +257,5 @@ | ||
return true; | ||
return packet; | ||
} catch (err) { | ||
this.emit('subscribe-error', err); | ||
return false; | ||
} | ||
@@ -263,0 +262,0 @@ } |
{ | ||
"name": "@dxos/broadcast", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Abstract module to send broadcast messages.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/dxos/broadcast#readme", |
@@ -112,3 +112,3 @@ # Broadcast | ||
- `subscribe: (onPacket) => unsubscribeFunction`: Defines how to subscribe to incoming packets. | ||
- `onPacket: (data: Buffer) => boolean`: Callback to process incoming data. It returns true if the broadcast could decode the message or false if not. | ||
- `onPacket: (data: Buffer) => (Packet|undefined)`: Callback to process incoming data. It returns true if the broadcast could decode the message or false if not. | ||
- `unsubscribeFunction: Function`: Defines a way to unsubscribe from listening messages if the broadcast stop working. Helpful if you are working with streams and event emitters. | ||
@@ -115,0 +115,0 @@ |
Sorry, the diff of this file is not supported yet
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
72892
404