-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.js
40 lines (32 loc) · 1.34 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Model } from "./model.js";
import { Dispatcher } from "./dispatcher.js";
import { State } from "./state.js";
import { Keyboard } from "./keyboard.js";
import { Panel } from "./panel.js";
import { Runner } from "./runner.js";
import { Selector } from "./selector.js";
import { Spinner } from "./spinner.js";
export { App };
/*************************************************************************************************/
/* App */
/*************************************************************************************************/
class App {
constructor() {
// Common objects.
this.state = new State();
this.model = new Model();
this.dispatcher = new Dispatcher();
// Components.
this.keyboard = new Keyboard(this.state, this.model, this.dispatcher);
this.panel = new Panel(this.state, this.model, this.dispatcher);
this.runner = new Runner(this.state, this.model, this.dispatcher);
this.selector = new Selector(this.state, this.model, this.dispatcher);
this.spinner = new Spinner(this.state, this.model, this.dispatcher);
}
init() {
this.model.init().then(async () => {
this.selector.init();
await this.runner.init();
});
}
};