Skip to content

MVC structure #11

@maurusrv

Description

@maurusrv
constructor(board, tiles, pieces) {
this.promotionPrompt = document.querySelector(
      ".promotion-prompt-container"
    );
    this.promotionPromptBlack = document.querySelector(
      ".promotion-prompt-black"
    );
    this.promotionPromptWhite = document.querySelector(
      ".promotion-prompt-white"
    );
    this.piecePromotionButton = document.querySelectorAll("[promotion-button]");
 ...

document calls should not be inside a class. this further improves MVC, separates concerns. anyway, you can pass it also as a parameter for the constructor like what you did in app.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions