Skip to content

Commit

Permalink
register the resize callback with addEventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Jun 29, 2022
1 parent bb46186 commit 319678a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ const state = {
};
window.gameState = state;

window.onresize = () => {
window.addEventListener("resize", () => {
state.shouldResize = true;
};
});
document.addEventListener(constants.reactIsLoaded, () => {
state.reactIsLoaded = true;
});
Expand Down

0 comments on commit 319678a

Please sign in to comment.