Node.js tutoria: Use await when calling run()

As it happens, the run() call is the last call in the app, so it also works without
await. But the moment somebody
adds code after run(), they'd be surprised
that it gets called
"before" run. So await for good measure.
This commit is contained in:
Simon Hausmann 2023-11-06 17:48:36 +01:00 committed by Simon Hausmann
parent ee096f4386
commit 7576ea71f2
3 changed files with 3 additions and 3 deletions

View file

@ -62,6 +62,6 @@ mainWindow.check_if_pair_solved = function () {
}
};
mainWindow.run();
await mainWindow.run();
// ANCHOR_END: game_logic

View file

@ -7,6 +7,6 @@ import * as slint from "slint-ui";
let ui = slint.loadFile("./memory.slint");
let mainWindow = new ui.MainWindow();
mainWindow.run();
await mainWindow.run();
// ANCHOR_END: main

View file

@ -18,6 +18,6 @@ for (let i = tiles.length - 1; i > 0; i--) {
let model = new slint.ArrayModel(tiles);
mainWindow.memory_tiles = model;
mainWindow.run();
await mainWindow.run();
// ANCHOR_END: main