Skip to content

Commit

Permalink
Add type checking to fallingLettersBeforeAndAfter
Browse files Browse the repository at this point in the history
  • Loading branch information
bytewife committed Sep 5, 2022
1 parent 924e499 commit 250bfe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/GameLoop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function GameLoop() {

const [didInstantDrop, setDidInstantDrop] = useState(false);

const [fallingLettersBeforeAndAfter, setFallingLetters] = useState([]);
const [fallingLettersBeforeAndAfter, setFallingLettersBeforeAndAfter] = useState([] as [BoardCell, BoardCell][]);

useEffect(() => {
globalThis.addEventListener("keydown", updatePlayerPos);
Expand Down Expand Up @@ -505,7 +505,7 @@ export function GameLoop() {
);

// Update falling letters & animation information.
setFallingLetters(_ => {
setFallingLettersBeforeAndAfter(_ => {
const newFallingLettersBeforeAndAfter = removed.map((k, i) => [k, added[i]]);

// Handle animation duration.
Expand Down

0 comments on commit 250bfe7

Please sign in to comment.