From 608ec9c72a35d29e270120666c7ff2ec9a1f4221 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 15 Dec 2022 22:14:47 +0100 Subject: [PATCH] Fix broken component descriptor --- src/js/Components.js | 5 +++-- src/js/Game.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/js/Components.js b/src/js/Components.js index 76c8d02..eef3b0b 100644 --- a/src/js/Components.js +++ b/src/js/Components.js @@ -9,13 +9,13 @@ const undoClass = "undo-game"; /** * Gets a component which represents the specified {@link game `game`}. * - * @param {import("./Game.js").Game} game + * @param {{game: import("./Game.js").Game }} game * The game represented in this app. * * @returns {NodeDescriptor} * The rendered node. */ -export function App(game) +export function App({ game }) { return [ "div", @@ -91,6 +91,7 @@ export function App(game) */ export function Board({ board }) { + console.log(board); let fields = board.flatMap((row) => row); return [ diff --git a/src/js/Game.js b/src/js/Game.js index 85cc48a..8fc29f4 100644 --- a/src/js/Game.js +++ b/src/js/Game.js @@ -1,6 +1,6 @@ import { App } from "./Components.js"; import { State } from "./State.js"; -import { SuiWeb } from "./SuiWeb.js"; +import { render } from "./SuiWeb.js"; /** * Represents a game. @@ -192,7 +192,7 @@ export class Game { let container = document.getElementById(this.id); container.innerHTML = ""; - SuiWeb.render([App, this], container); + render([App, { game: this }], container); } /**