Comparing version 0.1.17 to 0.1.18
@@ -55,4 +55,4 @@ 'use strict'; | ||
this.lastSentTimestamp = null; | ||
this.notifications = function () {}; | ||
this.onConnectCallback = function () {}; | ||
this.notifications = []; | ||
this.onConnectCallbacks = []; | ||
this.connect = function () { | ||
@@ -108,3 +108,5 @@ var ws = new WebSocket(address); | ||
} else { | ||
_this.notifications(null, message); | ||
_this.notifications.forEach(function (n) { | ||
return n(null, message); | ||
}); | ||
} | ||
@@ -122,3 +124,5 @@ }); | ||
_this.open = true; | ||
_this.onConnectCallback(); | ||
_this.onConnectCallbacks.forEach(function (cb) { | ||
return cb(); | ||
}); | ||
} | ||
@@ -145,3 +149,3 @@ }); | ||
value: function onConnect(cb) { | ||
this.onConnectCallback = cb; | ||
this.onConnectCallbacks.push(cb); | ||
} | ||
@@ -151,3 +155,3 @@ }, { | ||
value: function subscribe(cb) { | ||
this.notifications = cb; | ||
this.notifications.push(cb); | ||
} | ||
@@ -154,0 +158,0 @@ }, { |
{ | ||
"name": "obyte", | ||
"version": "0.1.17", | ||
"version": "0.1.18", | ||
"description": "A pure and powerful JavaScript Obyte library", | ||
@@ -5,0 +5,0 @@ "homepage": "https://obytejs.com", |
Sorry, the diff of this file is too big to display
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
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
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
1626
3301979
1