Actual build cancelled.

This commit is contained in:
2021-10-19 12:10:50 -03:00
parent 526fc9a0ab
commit ef9bb00792
10 changed files with 221 additions and 44 deletions

View File

@@ -0,0 +1,23 @@
import alphabet from './alphabet'
const AddLettersRegistered = (lastLetterRegistered, setLastLetterRegistered) => {
const addLetterHistory = (event) => {
const currentKey = event.key
if (!lastLetterRegistered.includes(currentKey.toUpperCase()) && alphabet.includes(currentKey.toLowerCase())) {
const array = [...lastLetterRegistered, currentKey.toUpperCase()]
setLastLetterRegistered(array)
console.log(lastLetterRegistered)
}
window.removeEventListener('keyup', addLetterHistory)
}
window.addEventListener('keyup', addLetterHistory)
}
export default AddLettersRegistered