UNPKG

25.5 kBSource Map (JSON)View Raw
1{"version":3,"file":"index.es6.js","sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nimport { ArrayExt, each, find } from '@lumino/algorithm';\n\n/**\n * A type alias for a slot function.\n *\n * @param sender - The object emitting the signal.\n *\n * @param args - The args object emitted with the signal.\n *\n * #### Notes\n * A slot is invoked when a signal to which it is connected is emitted.\n */\nexport type Slot<T, U> = (sender: T, args: U) => void;\n\n/**\n * An object used for type-safe inter-object communication.\n *\n * #### Notes\n * Signals provide a type-safe implementation of the publish-subscribe\n * pattern. An object (publisher) declares which signals it will emit,\n * and consumers connect callbacks (subscribers) to those signals. The\n * subscribers are invoked whenever the publisher emits the signal.\n */\nexport interface ISignal<T, U> {\n /**\n * Connect a slot to the signal.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n *\n * #### Notes\n * Slots are invoked in the order in which they are connected.\n *\n * Signal connections are unique. If a connection already exists for\n * the given `slot` and `thisArg`, this method returns `false`.\n *\n * A newly connected slot will not be invoked until the next time the\n * signal is emitted, even if the slot is connected while the signal\n * is dispatching.\n */\n connect(slot: Slot<T, U>, thisArg?: any): boolean;\n\n /**\n * Disconnect a slot from the signal.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n *\n * #### Notes\n * If no connection exists for the given `slot` and `thisArg`, this\n * method returns `false`.\n *\n * A disconnected slot will no longer be invoked, even if the slot\n * is disconnected while the signal is dispatching.\n */\n disconnect(slot: Slot<T, U>, thisArg?: any): boolean;\n}\n\n/**\n * A concrete implementation of `ISignal`.\n *\n * #### Example\n * ```typescript\n * import { ISignal, Signal } from '@lumino/signaling';\n *\n * class SomeClass {\n *\n * constructor(name: string) {\n * this.name = name;\n * }\n *\n * readonly name: string;\n *\n * get valueChanged: ISignal<this, number> {\n * return this._valueChanged;\n * }\n *\n * get value(): number {\n * return this._value;\n * }\n *\n * set value(value: number) {\n * if (value === this._value) {\n * return;\n * }\n * this._value = value;\n * this._valueChanged.emit(value);\n * }\n *\n * private _value = 0;\n * private _valueChanged = new Signal<this, number>(this);\n * }\n *\n * function logger(sender: SomeClass, value: number): void {\n * console.log(sender.name, value);\n * }\n *\n * let m1 = new SomeClass('foo');\n * let m2 = new SomeClass('bar');\n *\n * m1.valueChanged.connect(logger);\n * m2.valueChanged.connect(logger);\n *\n * m1.value = 42; // logs: foo 42\n * m2.value = 17; // logs: bar 17\n * ```\n */\nexport class Signal<T, U> implements ISignal<T, U> {\n /**\n * Construct a new signal.\n *\n * @param sender - The sender which owns the signal.\n */\n constructor(sender: T) {\n this.sender = sender;\n }\n\n /**\n * The sender which owns the signal.\n */\n readonly sender: T;\n\n /**\n * Connect a slot to the signal.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n connect(slot: Slot<T, U>, thisArg?: any): boolean {\n return Private.connect(this, slot, thisArg);\n }\n\n /**\n * Disconnect a slot from the signal.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n disconnect(slot: Slot<T, U>, thisArg?: any): boolean {\n return Private.disconnect(this, slot, thisArg);\n }\n\n /**\n * Emit the signal and invoke the connected slots.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n emit(args: U): void {\n Private.emit(this, args);\n }\n}\n\n/**\n * The namespace for the `Signal` class statics.\n */\nexport namespace Signal {\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n export function disconnectBetween(sender: any, receiver: any): void {\n Private.disconnectBetween(sender, receiver);\n }\n\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n export function disconnectSender(sender: any): void {\n Private.disconnectSender(sender);\n }\n\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n export function disconnectReceiver(receiver: any): void {\n Private.disconnectReceiver(receiver);\n }\n\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n *\n * #### Notes\n * If a `thisArg` is provided when connecting a signal, that object\n * is considered the receiver. Otherwise, the `slot` is considered\n * the receiver.\n */\n export function disconnectAll(object: any): void {\n Private.disconnectAll(object);\n }\n\n /**\n * Clear all signal data associated with the given object.\n *\n * @param object - The object for which the data should be cleared.\n *\n * #### Notes\n * This removes all signal connections and any other signal data\n * associated with the object.\n */\n export function clearData(object: any): void {\n Private.disconnectAll(object);\n }\n\n /**\n * A type alias for the exception handler function.\n */\n export type ExceptionHandler = (err: Error) => void;\n\n /**\n * Get the signal exception handler.\n *\n * @returns The current exception handler.\n *\n * #### Notes\n * The default exception handler is `console.error`.\n */\n export function getExceptionHandler(): ExceptionHandler {\n return Private.exceptionHandler;\n }\n\n /**\n * Set the signal exception handler.\n *\n * @param handler - The function to use as the exception handler.\n *\n * @returns The old exception handler.\n *\n * #### Notes\n * The exception handler is invoked when a slot throws an exception.\n */\n export function setExceptionHandler(\n handler: ExceptionHandler\n ): ExceptionHandler {\n let old = Private.exceptionHandler;\n Private.exceptionHandler = handler;\n return old;\n }\n}\n\n/**\n * The namespace for the module implementation details.\n */\nnamespace Private {\n /**\n * The signal exception handler function.\n */\n export let exceptionHandler: Signal.ExceptionHandler = (err: Error) => {\n console.error(err);\n };\n\n /**\n * Connect a slot to a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to invoke when the signal is emitted.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection succeeds, `false` otherwise.\n */\n export function connect<T, U>(\n signal: Signal<T, U>,\n slot: Slot<T, U>,\n thisArg?: any\n ): boolean {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n\n // Ensure the sender's array of receivers is created.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers) {\n receivers = [];\n receiversForSender.set(signal.sender, receivers);\n }\n\n // Bail if a matching connection already exists.\n if (findConnection(receivers, signal, slot, thisArg)) {\n return false;\n }\n\n // Choose the best object for the receiver.\n let receiver = thisArg || slot;\n\n // Ensure the receiver's array of senders is created.\n let senders = sendersForReceiver.get(receiver);\n if (!senders) {\n senders = [];\n sendersForReceiver.set(receiver, senders);\n }\n\n // Create a new connection and add it to the end of each array.\n let connection = { signal, slot, thisArg };\n receivers.push(connection);\n senders.push(connection);\n\n // Indicate a successful connection.\n return true;\n }\n\n /**\n * Disconnect a slot from a signal.\n *\n * @param signal - The signal of interest.\n *\n * @param slot - The slot to disconnect from the signal.\n *\n * @param thisArg - The `this` context for the slot. If provided,\n * this must be a non-primitive object.\n *\n * @returns `true` if the connection is removed, `false` otherwise.\n */\n export function disconnect<T, U>(\n signal: Signal<T, U>,\n slot: Slot<T, U>,\n thisArg?: any\n ): boolean {\n // Coerce a `null` `thisArg` to `undefined`.\n thisArg = thisArg || undefined;\n\n // Lookup the list of receivers, and bail if none exist.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return false;\n }\n\n // Bail if no matching connection exits.\n let connection = findConnection(receivers, signal, slot, thisArg);\n if (!connection) {\n return false;\n }\n\n // Choose the best object for the receiver.\n let receiver = thisArg || slot;\n\n // Lookup the array of senders, which is now known to exist.\n let senders = sendersForReceiver.get(receiver)!;\n\n // Clear the connection and schedule cleanup of the arrays.\n connection.signal = null;\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n\n // Indicate a successful disconnection.\n return true;\n }\n\n /**\n * Remove all connections between a sender and receiver.\n *\n * @param sender - The sender object of interest.\n *\n * @param receiver - The receiver object of interest.\n */\n export function disconnectBetween(sender: any, receiver: any): void {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n\n // If there are no senders, there is nothing to do.\n let senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n\n // Clear each connection between the sender and receiver.\n each(senders, connection => {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n return;\n }\n\n // Clear the connection if it matches the sender.\n if (connection.signal.sender === sender) {\n connection.signal = null;\n }\n });\n\n // Schedule a cleanup of the senders and receivers.\n scheduleCleanup(receivers);\n scheduleCleanup(senders);\n }\n\n /**\n * Remove all connections where the given object is the sender.\n *\n * @param sender - The sender object of interest.\n */\n export function disconnectSender(sender: any): void {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n\n // Clear each receiver connection.\n each(receivers, connection => {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n return;\n }\n\n // Choose the best object for the receiver.\n let receiver = connection.thisArg || connection.slot;\n\n // Clear the connection.\n connection.signal = null;\n\n // Cleanup the array of senders, which is now known to exist.\n scheduleCleanup(sendersForReceiver.get(receiver)!);\n });\n\n // Schedule a cleanup of the receivers.\n scheduleCleanup(receivers);\n }\n\n /**\n * Remove all connections where the given object is the receiver.\n *\n * @param receiver - The receiver object of interest.\n */\n export function disconnectReceiver(receiver: any): void {\n // If there are no senders, there is nothing to do.\n let senders = sendersForReceiver.get(receiver);\n if (!senders || senders.length === 0) {\n return;\n }\n\n // Clear each sender connection.\n each(senders, connection => {\n // Skip connections which have already been cleared.\n if (!connection.signal) {\n return;\n }\n\n // Lookup the sender for the connection.\n let sender = connection.signal.sender;\n\n // Clear the connection.\n connection.signal = null;\n\n // Cleanup the array of receivers, which is now known to exist.\n scheduleCleanup(receiversForSender.get(sender)!);\n });\n\n // Schedule a cleanup of the list of senders.\n scheduleCleanup(senders);\n }\n\n /**\n * Remove all connections where an object is the sender or receiver.\n *\n * @param object - The object of interest.\n */\n export function disconnectAll(object: any): void {\n // Remove all connections where the given object is the sender.\n disconnectSender(object);\n // Remove all connections where the given object is the receiver.\n disconnectReceiver(object);\n }\n\n /**\n * Emit a signal and invoke its connected slots.\n *\n * @param signal - The signal of interest.\n *\n * @param args - The args to pass to the connected slots.\n *\n * #### Notes\n * Slots are invoked synchronously in connection order.\n *\n * Exceptions thrown by connected slots will be caught and logged.\n */\n export function emit<T, U>(signal: Signal<T, U>, args: U): void {\n // If there are no receivers, there is nothing to do.\n let receivers = receiversForSender.get(signal.sender);\n if (!receivers || receivers.length === 0) {\n return;\n }\n\n // Invoke the slots for connections with a matching signal.\n // Any connections added during emission are not invoked.\n for (let i = 0, n = receivers.length; i < n; ++i) {\n let connection = receivers[i];\n if (connection.signal === signal) {\n invokeSlot(connection, args);\n }\n }\n }\n\n /**\n * An object which holds connection data.\n */\n interface IConnection {\n /**\n * The signal for the connection.\n *\n * A `null` signal indicates a cleared connection.\n */\n signal: Signal<any, any> | null;\n\n /**\n * The slot connected to the signal.\n */\n readonly slot: Slot<any, any>;\n\n /**\n * The `this` context for the slot.\n */\n readonly thisArg: any;\n }\n\n /**\n * A weak mapping of sender to array of receiver connections.\n */\n const receiversForSender = new WeakMap<any, IConnection[]>();\n\n /**\n * A weak mapping of receiver to array of sender connections.\n */\n const sendersForReceiver = new WeakMap<any, IConnection[]>();\n\n /**\n * A set of connection arrays which are pending cleanup.\n */\n const dirtySet = new Set<IConnection[]>();\n\n /**\n * A function to schedule an event loop callback.\n */\n const schedule = (() => {\n let ok = typeof requestAnimationFrame === 'function';\n // @ts-ignore\n return ok ? requestAnimationFrame : setImmediate;\n })();\n\n /**\n * Find a connection which matches the given parameters.\n */\n function findConnection(\n connections: IConnection[],\n signal: Signal<any, any>,\n slot: Slot<any, any>,\n thisArg: any\n ): IConnection | undefined {\n return find(\n connections,\n connection =>\n connection.signal === signal &&\n connection.slot === slot &&\n connection.thisArg === thisArg\n );\n }\n\n /**\n * Invoke a slot with the given parameters.\n *\n * The connection is assumed to be valid.\n *\n * Exceptions in the slot will be caught and logged.\n */\n function invokeSlot(connection: IConnection, args: any): void {\n let { signal, slot, thisArg } = connection;\n try {\n slot.call(thisArg, signal!.sender, args);\n } catch (err) {\n exceptionHandler(err);\n }\n }\n\n /**\n * Schedule a cleanup of a connection array.\n *\n * This will add the array to the dirty set and schedule a deferred\n * cleanup of the array contents. On cleanup, any connection with a\n * `null` signal will be removed from the array.\n */\n function scheduleCleanup(array: IConnection[]): void {\n if (dirtySet.size === 0) {\n schedule(cleanupDirtySet);\n }\n dirtySet.add(array);\n }\n\n /**\n * Cleanup the connection lists in the dirty set.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupDirtySet(): void {\n dirtySet.forEach(cleanupConnections);\n dirtySet.clear();\n }\n\n /**\n * Cleanup the dirty connections in a connections array.\n *\n * This will remove any connection with a `null` signal.\n *\n * This function should only be invoked asynchronously, when the\n * stack frame is guaranteed to not be on the path of user code.\n */\n function cleanupConnections(connections: IConnection[]): void {\n ArrayExt.removeAllWhere(connections, isDeadConnection);\n }\n\n /**\n * Test whether a connection is dead.\n *\n * A dead connection has a `null` signal.\n */\n function isDeadConnection(connection: IConnection): boolean {\n return connection.signal === null;\n }\n}\n"],"names":[],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