@scalar/api-client
Version:
the open source API testing client
12 lines (11 loc) • 356 B
JavaScript
import { onMounted as d, onBeforeUnmount as i, toValue as s } from "vue";
import { handleHotkeys as w } from "../helpers/handle-hotkeys.js";
const l = (o, n, t) => {
const e = (r) => {
s(t) || w(r, o, n);
};
d(() => window.addEventListener("keydown", e)), i(() => window.removeEventListener("keydown", e));
};
export {
l as useGlobalHotKeys
};