callback-registry
Advanced tools
Comparing version 2.4.0 to 2.5.1
@@ -26,2 +26,7 @@ /** | ||
clear(): void; | ||
/** | ||
* Removes a specific key and its associated callbacks from the registry. | ||
*/ | ||
clearKey(key: string): void; | ||
} | ||
@@ -28,0 +33,0 @@ |
@@ -77,6 +77,14 @@ "use strict"; | ||
} | ||
function clearKey(key) { | ||
var callbacksForKey = callbacks[key]; | ||
if (!callbacksForKey) { | ||
return; | ||
} | ||
delete callbacks[key]; | ||
} | ||
return { | ||
add: add, | ||
execute: execute, | ||
clear: clear | ||
clear: clear, | ||
clearKey: clearKey | ||
}; | ||
@@ -83,0 +91,0 @@ } |
{ | ||
"name": "callback-registry", | ||
"version": "2.4.0", | ||
"version": "2.5.1", | ||
"description": "Registry for callbacks", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -46,2 +46,4 @@ # Intro | ||
# Change log | ||
* 2.5.0 | ||
added clearKey method that removes a key from the registry | ||
* 2.3.2 | ||
@@ -48,0 +50,0 @@ * fix case where unsubscribe function removes all subscriptions with the same callback reference |
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
7859
130
53
0