-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
51 lines (48 loc) · 1.29 KB
/
index.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
41
42
43
44
45
46
47
48
49
50
51
import { app } from "./web_modules/hyperapp.js";
import { worldMap } from "./countriesMap.js";
import { chartView, ChartListen } from "./chart.js";
import { html } from "./html.js";
import { Container } from "./container.js";
import { header } from "./header.js";
import { tab } from "./tab.js";
import { table } from "./table.js";
import { select } from "./select.js";
import { countryChips } from "./country.js";
import { fetchReport } from "./fetch.js";
import { initialState } from "./state.js";
import {
LoadPreferences,
SavePreferencesListen,
CleanPreferencesOnErrorListen
} from "./preferences.js";
import { HistoryListen, ReadStateFromUrl } from "./history.js";
// import logger from "./web_modules/hyperapp-v2-basiclogger.js";
const main = state => html`
<${Container}>
${countryChips(state)} ${chartView(state)} ${select(state)} ${worldMap(
state
)}
${countryChips(state)}
</Container>
`;
const view = state =>
html`
<div>
${header} ${tab(state)} ${main(state)} ${table(state)}
</div>
`;
app({
init: [
initialState,
CleanPreferencesOnErrorListen,
LoadPreferences,
fetchReport,
ChartListen,
ReadStateFromUrl,
SavePreferencesListen,
HistoryListen
],
view,
// middleware: logger,
node: document.getElementById("app")
});