-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from JollyGrin/bug/fix-grave
Bug/fix grave
- Loading branch information
Showing
7 changed files
with
54 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
#### 18:03 | ||
- i think i finally got it working. i made a huge debugger and was finding where things were not hitting. just logged personal and global and found a mismatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { GRIDS } from "@/components/organisms/GameBoard/constants"; | ||
import { GameState } from "@/types/card"; | ||
|
||
/** | ||
* Having trouble understanding the state? | ||
* Throw this around state anywhere to see a table in the console logs | ||
* */ | ||
export function debugState(state: GameState) { | ||
// Transform each row into an object that includes the `id` from each object | ||
const arrayOfObjects = state.map((row, rowIndex) => { | ||
// Start with the row name from the enum | ||
const rowObject = { "Row Name": GRIDS[rowIndex] }; | ||
|
||
// Add the id from each object in the row | ||
row.forEach((obj, colIndex) => { | ||
//@ts-expect-error: do not care, it works | ||
rowObject[`Card Index ${colIndex}`] = obj.id; | ||
}); | ||
|
||
return rowObject; | ||
}); | ||
console.table(arrayOfObjects); | ||
} |