@phosphor/signaling
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -211,2 +211,26 @@ /** | ||
function clearData(object: any): void; | ||
/** | ||
* A type alias for the exception handler function. | ||
*/ | ||
type ExceptionHandler = (err: Error) => void; | ||
/** | ||
* Get the signal exception handler. | ||
* | ||
* @returns The current exception handler. | ||
* | ||
* #### Notes | ||
* The default exception handler is `console.error`. | ||
*/ | ||
function getExceptionHandler(): ExceptionHandler; | ||
/** | ||
* Set the signal exception handler. | ||
* | ||
* @param handler - The function to use as the exception handler. | ||
* | ||
* @returns The old exception handler. | ||
* | ||
* #### Notes | ||
* The exception handler is invoked when a slot throws an exception. | ||
*/ | ||
function setExceptionHandler(handler: ExceptionHandler): ExceptionHandler; | ||
} |
@@ -181,2 +181,30 @@ "use strict"; | ||
Signal.clearData = clearData; | ||
/** | ||
* Get the signal exception handler. | ||
* | ||
* @returns The current exception handler. | ||
* | ||
* #### Notes | ||
* The default exception handler is `console.error`. | ||
*/ | ||
function getExceptionHandler() { | ||
return Private.exceptionHandler; | ||
} | ||
Signal.getExceptionHandler = getExceptionHandler; | ||
/** | ||
* Set the signal exception handler. | ||
* | ||
* @param handler - The function to use as the exception handler. | ||
* | ||
* @returns The old exception handler. | ||
* | ||
* #### Notes | ||
* The exception handler is invoked when a slot throws an exception. | ||
*/ | ||
function setExceptionHandler(handler) { | ||
var old = Private.exceptionHandler; | ||
Private.exceptionHandler = handler; | ||
return old; | ||
} | ||
Signal.setExceptionHandler = setExceptionHandler; | ||
})(Signal = exports.Signal || (exports.Signal = {})); | ||
@@ -190,2 +218,6 @@ exports.Signal = Signal; | ||
/** | ||
* The signal exception handler function. | ||
*/ | ||
Private.exceptionHandler = console.error; | ||
/** | ||
* Connect a slot to a signal. | ||
@@ -446,3 +478,3 @@ * | ||
catch (err) { | ||
console.error(err); | ||
Private.exceptionHandler(err); | ||
} | ||
@@ -449,0 +481,0 @@ } |
{ | ||
"name": "@phosphor/signaling", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "PhosphorJS - Signals and Slots", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
26410
756