@blackmagic-controller/core
Version:
An npm module for interfacing with the Blackmagic usb/bluetooth controllers
15 lines • 402 B
JavaScript
/**
* 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