@tanstack/hotkeys
Version:
Type-safe, framework-agnostic keyboard hotkey management for the browser
12 lines (11 loc) • 420 B
JavaScript
// src/_app-hotkeys-factory.ts
let factory;
function setAppHotkeysStoreFactory(create) {
factory = create;
}
/** Creates the store for app hotkeys from `defineAppHotkeys`. */
function createAppHotkeysStore(appHotkeys, options) {
if (!factory) throw new Error("[hotkeys] App hotkeys must come from defineAppHotkeys");
return factory(appHotkeys, options);
}
export { createAppHotkeysStore, setAppHotkeysStoreFactory };