-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.fs
43 lines (34 loc) · 876 Bytes
/
App.fs
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
namespace Fun.Blazor.Sample
open FSharp.Data.Adaptive
open Fun.Blazor
module App =
let private counter initial =
adaptiview () {
let! counter, setCounter = cval(initial).WithSetter()
p { childContent $"Count: {counter}" }
button {
onclick (fun _ -> setCounter (counter + 1))
childContent "Increment"
}
button {
onclick (fun _ -> setCounter (counter - 1))
childContent "Decrement"
}
button {
onclick (fun _ -> setCounter (initial))
childContent "Reset"
}
}
let View () =
article {
class' "app"
main {
h1 { "Welcome to Fun.Blazor!" }
section { childContent (counter 0) }
section { childContent (counter 100) }
}
footer{
class' "app-footer"
childContent "Fun.Blazor.Sample"
}
}