Skip to content

Commit

Permalink
fix: allow string list in useKeyboardJs hook
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich authored Aug 2, 2019
2 parents 4a87d63 + b7481f6 commit aecbd0b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/useKeyboardJs.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ yarn add keyboardjs
## Reference

```js
useKeyboardJs(combination: string): [isPressed: boolean, event?: KeyboardEvent]
useKeyboardJs(combination: string | string[]): [isPressed: boolean, event?: KeyboardEvent]
```
2 changes: 1 addition & 1 deletion src/__stories__/useKeyboardJs.story.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { text, withKnobs } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import * as React from 'react';
import { useKeyboardJs } from '..';
import useKeyboardJs from '../useKeyboardJs';
import { CenterStory } from './util/CenterStory';
import ShowDocs from './util/ShowDocs';

Expand Down
2 changes: 1 addition & 1 deletion src/useKeyboardJs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import useMount from './useMount';

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

Expand Down

0 comments on commit aecbd0b

Please sign in to comment.