Skip to content

Commit

Permalink
Expose isHotkeyPressed without the Hook. Deprecate useIsHotkeyPressed
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesKlauss committed Jul 23, 2021
1 parent 94a797e commit a17c33c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { useIsHotkeyPressed } from './useIsHotkeyPressed';
import { useHotkeys, Options } from './useHotkeys';
import hotkeys from 'hotkeys-js';

export { useHotkeys, useIsHotkeyPressed, Options };
const isHotkeyPressed = hotkeys.isPressed;

export { useHotkeys, useIsHotkeyPressed, isHotkeyPressed, Options };
3 changes: 3 additions & 0 deletions src/useIsHotkeyPressed.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import hotkeys from 'hotkeys-js';

/**
* @deprecated Use isHotkeyPressed instead. Will be removed version 4.
*/
export function useIsHotkeyPressed() {
return hotkeys.isPressed;
}

0 comments on commit a17c33c

Please sign in to comment.