Creating the Konami Code as React Hook

added by JavaScript Kicks
10/2/2020 12:45:13 PM

1055 Views

First I'll add the KonamiCode to the useKonamiCode.js. This sequence will be used to check against the key events. const konamiCode = [ "ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "KeyB", "KeyA",]; Next I want to create the React Hook and setup the state I will need.


0 comments