Comparing version 1.5.1 to 1.5.2
{ | ||
"name": "PubSubJS", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"main": "src/pubsub.js", | ||
@@ -5,0 +5,0 @@ "ignore": [ |
{ | ||
"name": "pubsub-js", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "Dependency free publish/subscribe library", | ||
@@ -5,0 +5,0 @@ "main": "./src/pubsub.js", |
@@ -174,6 +174,17 @@ /* | ||
*/ | ||
PubSub.clearAllSubscriptions = function clearSubscriptions(){ | ||
PubSub.clearAllSubscriptions = function clearAllSubscriptions(){ | ||
messages = {}; | ||
}; | ||
/*Public: Clear subscriptions by the topic | ||
*/ | ||
PubSub.clearSubscriptions = function clearSubscriptions(topic){ | ||
var m; | ||
for (m in messages){ | ||
if (messages.hasOwnProperty(m) && m.indexOf(topic) === 0){ | ||
delete messages[m]; | ||
} | ||
} | ||
}; | ||
/* Public: removes subscriptions. | ||
@@ -180,0 +191,0 @@ * When passed a token, removes a specific subscription. |
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
304072
8782