UNPKG

@tanstack/hotkeys

Version:

Type-safe, framework-agnostic keyboard hotkey management for the browser

13 lines (12 loc) • 441 B
//#region 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); } //#endregion export { createAppHotkeysStore, setAppHotkeysStoreFactory };