@lumino/signaling
Advanced tools
Comparing version 1.7.2 to 1.8.0
@@ -445,5 +445,7 @@ import { find, each, ArrayExt } from '@lumino/algorithm'; | ||
function findConnection(connections, signal, slot, thisArg) { | ||
return find(connections, function (connection) { return (connection.signal === signal && | ||
connection.slot === slot && | ||
connection.thisArg === thisArg); }); | ||
return find(connections, function (connection) { | ||
return connection.signal === signal && | ||
connection.slot === slot && | ||
connection.thisArg === thisArg; | ||
}); | ||
} | ||
@@ -450,0 +452,0 @@ /** |
@@ -449,5 +449,7 @@ (function (global, factory) { | ||
function findConnection(connections, signal, slot, thisArg) { | ||
return algorithm.find(connections, function (connection) { return (connection.signal === signal && | ||
connection.slot === slot && | ||
connection.thisArg === thisArg); }); | ||
return algorithm.find(connections, function (connection) { | ||
return connection.signal === signal && | ||
connection.slot === slot && | ||
connection.thisArg === thisArg; | ||
}); | ||
} | ||
@@ -454,0 +456,0 @@ /** |
{ | ||
"name": "@lumino/signaling", | ||
"version": "1.7.2", | ||
"version": "1.8.0", | ||
"description": "Lumino Signals and Slots", | ||
@@ -47,3 +47,3 @@ "homepage": "https://github.com/jupyterlab/lumino", | ||
"dependencies": { | ||
"@lumino/algorithm": "^1.6.2" | ||
"@lumino/algorithm": "^1.7.0" | ||
}, | ||
@@ -76,4 +76,3 @@ "devDependencies": { | ||
"access": "public" | ||
}, | ||
"gitHead": "79b0d03a9d78fbc7055114bdafbd9d5d531490ce" | ||
} | ||
} |
@@ -10,8 +10,4 @@ // Copyright (c) Jupyter Development Team. | ||
|----------------------------------------------------------------------------*/ | ||
import { | ||
ArrayExt, each, find | ||
} from '@lumino/algorithm'; | ||
import { ArrayExt, each, find } from '@lumino/algorithm'; | ||
/** | ||
@@ -27,6 +23,4 @@ * A type alias for a slot function. | ||
*/ | ||
export | ||
type Slot<T, U> = (sender: T, args: U) => void; | ||
export type Slot<T, U> = (sender: T, args: U) => void; | ||
/** | ||
@@ -41,4 +35,3 @@ * An object used for type-safe inter-object communication. | ||
*/ | ||
export | ||
interface ISignal<T, U> { | ||
export interface ISignal<T, U> { | ||
/** | ||
@@ -86,3 +79,2 @@ * Connect a slot to the signal. | ||
/** | ||
@@ -137,4 +129,3 @@ * A concrete implementation of `ISignal`. | ||
*/ | ||
export | ||
class Signal<T, U> implements ISignal<T, U> { | ||
export class Signal<T, U> implements ISignal<T, U> { | ||
/** | ||
@@ -197,8 +188,6 @@ * Construct a new signal. | ||
/** | ||
* The namespace for the `Signal` class statics. | ||
*/ | ||
export | ||
namespace Signal { | ||
export namespace Signal { | ||
/** | ||
@@ -216,4 +205,3 @@ * Remove all connections between a sender and receiver. | ||
*/ | ||
export | ||
function disconnectBetween(sender: any, receiver: any): void { | ||
export function disconnectBetween(sender: any, receiver: any): void { | ||
Private.disconnectBetween(sender, receiver); | ||
@@ -227,4 +215,3 @@ } | ||
*/ | ||
export | ||
function disconnectSender(sender: any): void { | ||
export function disconnectSender(sender: any): void { | ||
Private.disconnectSender(sender); | ||
@@ -243,4 +230,3 @@ } | ||
*/ | ||
export | ||
function disconnectReceiver(receiver: any): void { | ||
export function disconnectReceiver(receiver: any): void { | ||
Private.disconnectReceiver(receiver); | ||
@@ -259,4 +245,3 @@ } | ||
*/ | ||
export | ||
function disconnectAll(object: any): void { | ||
export function disconnectAll(object: any): void { | ||
Private.disconnectAll(object); | ||
@@ -274,4 +259,3 @@ } | ||
*/ | ||
export | ||
function clearData(object: any): void { | ||
export function clearData(object: any): void { | ||
Private.disconnectAll(object); | ||
@@ -283,4 +267,3 @@ } | ||
*/ | ||
export | ||
type ExceptionHandler = (err: Error) => void; | ||
export type ExceptionHandler = (err: Error) => void; | ||
@@ -295,4 +278,3 @@ /** | ||
*/ | ||
export | ||
function getExceptionHandler(): ExceptionHandler { | ||
export function getExceptionHandler(): ExceptionHandler { | ||
return Private.exceptionHandler; | ||
@@ -311,4 +293,5 @@ } | ||
*/ | ||
export | ||
function setExceptionHandler(handler: ExceptionHandler): ExceptionHandler { | ||
export function setExceptionHandler( | ||
handler: ExceptionHandler | ||
): ExceptionHandler { | ||
let old = Private.exceptionHandler; | ||
@@ -320,3 +303,2 @@ Private.exceptionHandler = handler; | ||
/** | ||
@@ -329,4 +311,3 @@ * The namespace for the module implementation details. | ||
*/ | ||
export | ||
let exceptionHandler: Signal.ExceptionHandler = (err: Error) => { | ||
export let exceptionHandler: Signal.ExceptionHandler = (err: Error) => { | ||
console.error(err); | ||
@@ -347,4 +328,7 @@ }; | ||
*/ | ||
export | ||
function connect<T, U>(signal: Signal<T, U>, slot: Slot<T, U>, thisArg?: any): boolean { | ||
export function connect<T, U>( | ||
signal: Signal<T, U>, | ||
slot: Slot<T, U>, | ||
thisArg?: any | ||
): boolean { | ||
// Coerce a `null` `thisArg` to `undefined`. | ||
@@ -396,4 +380,7 @@ thisArg = thisArg || undefined; | ||
*/ | ||
export | ||
function disconnect<T, U>(signal: Signal<T, U>, slot: Slot<T, U>, thisArg?: any): boolean { | ||
export function disconnect<T, U>( | ||
signal: Signal<T, U>, | ||
slot: Slot<T, U>, | ||
thisArg?: any | ||
): boolean { | ||
// Coerce a `null` `thisArg` to `undefined`. | ||
@@ -436,4 +423,3 @@ thisArg = thisArg || undefined; | ||
*/ | ||
export | ||
function disconnectBetween(sender: any, receiver: any): void { | ||
export function disconnectBetween(sender: any, receiver: any): void { | ||
// If there are no receivers, there is nothing to do. | ||
@@ -474,4 +460,3 @@ let receivers = receiversForSender.get(sender); | ||
*/ | ||
export | ||
function disconnectSender(sender: any): void { | ||
export function disconnectSender(sender: any): void { | ||
// If there are no receivers, there is nothing to do. | ||
@@ -509,4 +494,3 @@ let receivers = receiversForSender.get(sender); | ||
*/ | ||
export | ||
function disconnectReceiver(receiver: any): void { | ||
export function disconnectReceiver(receiver: any): void { | ||
// If there are no senders, there is nothing to do. | ||
@@ -544,4 +528,3 @@ let senders = sendersForReceiver.get(receiver); | ||
*/ | ||
export | ||
function disconnectAll(object: any): void { | ||
export function disconnectAll(object: any): void { | ||
// Remove all connections where the given object is the sender. | ||
@@ -565,4 +548,3 @@ disconnectSender(object); | ||
*/ | ||
export | ||
function emit<T, U>(signal: Signal<T, U>, args: U): void { | ||
export function emit<T, U>(signal: Signal<T, U>, args: U): void { | ||
// If there are no receivers, there is nothing to do. | ||
@@ -633,8 +615,15 @@ let receivers = receiversForSender.get(signal.sender); | ||
*/ | ||
function findConnection(connections: IConnection[], signal: Signal<any, any>, slot: Slot<any, any>, thisArg: any): IConnection | undefined { | ||
return find(connections, connection => ( | ||
connection.signal === signal && | ||
connection.slot === slot && | ||
connection.thisArg === thisArg | ||
)); | ||
function findConnection( | ||
connections: IConnection[], | ||
signal: Signal<any, any>, | ||
slot: Slot<any, any>, | ||
thisArg: any | ||
): IConnection | undefined { | ||
return find( | ||
connections, | ||
connection => | ||
connection.signal === signal && | ||
connection.slot === slot && | ||
connection.thisArg === thisArg | ||
); | ||
} | ||
@@ -641,0 +630,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
142813
10
1875
Updated@lumino/algorithm@^1.7.0