Skip to content

Commit aecbd0b

Browse files
authored
fix: allow string list in useKeyboardJs hook
2 parents 4a87d63 + b7481f6 commit aecbd0b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/useKeyboardJs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ yarn add keyboardjs
3737
## Reference
3838

3939
```js
40-
useKeyboardJs(combination: string): [isPressed: boolean, event?: KeyboardEvent]
40+
useKeyboardJs(combination: string | string[]): [isPressed: boolean, event?: KeyboardEvent]
4141
```

src/__stories__/useKeyboardJs.story.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { text, withKnobs } from '@storybook/addon-knobs';
22
import { storiesOf } from '@storybook/react';
33
import * as React from 'react';
4-
import { useKeyboardJs } from '..';
4+
import useKeyboardJs from '../useKeyboardJs';
55
import { CenterStory } from './util/CenterStory';
66
import ShowDocs from './util/ShowDocs';
77

src/useKeyboardJs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect, useState } from 'react';
22
import useMount from './useMount';
33

4-
const useKeyboardJs = (combination: string) => {
4+
const useKeyboardJs = (combination: string | string[]) => {
55
const [state, set] = useState<[boolean, null | KeyboardEvent]>([false, null]);
66
const [keyboardJs, setKeyboardJs] = useState<any>(null);
77

0 commit comments

Comments
 (0)