Added docs to useKeyboard

This commit is contained in:
Mitchell McCaffrey 2020-10-13 06:52:42 +11:00
parent 266ea0d218
commit c543f15c81

View File

@ -2,6 +2,10 @@ import { useEffect, useContext } from "react";
import KeyboardContext from "../contexts/KeyboardContext";
/**
* @param {KeyboardEvent} onKeyDown
* @param {KeyboardEvent} onKeyUp
*/
function useKeyboard(onKeyDown, onKeyUp) {
const { keyEmitter } = useContext(KeyboardContext);
useEffect(() => {