UNPKG

@logitech-mx-creative-console/core

Version:

An npm module for interfacing with the Logitech MX Creative Console

15 lines 402 B
/** * A simple helper that allows for the delayed registering of a listener, to avoid dependency cycles */ export class CallbackHook { #listener = null; emit(key, ...args) { if (!this.#listener) throw new Error('No listener setup'); this.#listener(key, ...args); } listen(fn) { this.#listener = fn; } } //# sourceMappingURL=callback-hook.js.map