-
Notifications
You must be signed in to change notification settings - Fork 2
/
Mod.mjs
46 lines (40 loc) · 884 Bytes
/
Mod.mjs
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
export const View = state =>
div({ class: 'Mod' }, [
h3('Mod.Mod'),
p([
'this is Mod. it gets loaded from ',
Link(
{ to: 'https://github.com/magic/core/blob/master/example/assets/modules/Mod.mjs' },
'/assets/modules/Mod.mjs',
),
]),
p(['the state of this module: ', JSON.stringify(state.module)]),
])
export const state = {
module: {
test: 'testing',
},
}
export const style = vars => ({
margin: '0 0 1em',
padding: '0.5em',
border: '1px solid',
borderColor: 'green',
h3: {
margin: 0,
color: vars.text.dark,
},
})
export const global = {
state: {
module: true,
},
}
// export const server = (req, res) => {
// const random = Math.floor(Math.random() * 1000)
// const body = `hello, world. here is some pseudorandom: ${random}`
// return {
// code: 200,
// body,
// }
// }