typed-signals
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -58,2 +58,9 @@ /** | ||
/** | ||
* Unsubscribe from this signal with the original callback instance. | ||
* While you can use this method, the SignalConnection returned by connect() will not be updated! | ||
* | ||
* @param callback The callback you passed to connect(). | ||
*/ | ||
disconnect(callback: CB): boolean; | ||
/** | ||
* Disconnect all handlers from this signal event. | ||
@@ -60,0 +67,0 @@ */ |
@@ -148,2 +148,17 @@ "use strict"; | ||
/** | ||
* Unsubscribe from this signal with the original callback instance. | ||
* While you can use this method, the SignalConnection returned by connect() will not be updated! | ||
* | ||
* @param callback The callback you passed to connect(). | ||
*/ | ||
Signal.prototype.disconnect = function (callback) { | ||
for (var link = this.head.next; link !== this.head; link = link.next) { | ||
if (link.callback === callback) { | ||
link.unlink(); | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
/** | ||
* Disconnect all handlers from this signal event. | ||
@@ -150,0 +165,0 @@ */ |
{ | ||
"name": "typed-signals", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A type checked signal library for TypeScript (and JavaScript)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
46325
843