UNPKG

@blackmagic-controller/core

Version:

An npm module for interfacing with the Blackmagic usb/bluetooth controllers

19 lines 540 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CallbackHook = void 0; /** * A simple helper that allows for the delayed registering of a listener, to avoid dependency cycles */ 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; } } exports.CallbackHook = CallbackHook; //# sourceMappingURL=callback-hook.js.map