Skip to content

Commit 147f8b3

Browse files
committed
Added async.
1 parent fceb369 commit 147f8b3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/app.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import {R,X} from '../node_modules/brutalist-web/r.js';
22

33
const appState = {
4+
name: 'anon',
45
loggedIn: getCode()
56
};
67

7-
App(appState).to('main.app', 'innerHTML');
8+
start();
89

9-
function App(state) {
10+
async function start() {
11+
(await App(appState)).to('main.app', 'innerHTML');
12+
}
13+
14+
async function App(state) {
1015
const s = Object.assign({}, state);
1116
return R`
1217
<article class="holygrail debug">
@@ -66,7 +71,7 @@ function Post(state) {
6671
}
6772

6873
function UserMenu(state) {
69-
return R`<span class=usermenu>${state.userMenu.name}</span>`;
74+
return R`<span class=usermenu>${state.name}</span>`;
7075
}
7176

7277
function LogIn(state) {

0 commit comments

Comments
 (0)