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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//! <b>[Examples:](https://github.com/colbyn/subscript/tree/master/examples)</b>
//! * [Client <-> Server](https://github.com/colbyn/subscript/tree/master/examples/client-server)
//! * [Counter App](https://github.com/colbyn/subscript/tree/master/examples/counter-app)
//! * [Nav App](https://github.com/colbyn/subscript/tree/master/examples/nav-app) (currently perhaps the best example feature-wise)
//! * [Saas App](https://github.com/colbyn/subscript/tree/master/examples/saas-app)
//! * [Todo App](https://github.com/colbyn/subscript/tree/master/examples/todo-app)
//!
//! # [Counter Component Preview:](https://github.com/colbyn/subscript/tree/master/examples/counter-app)
//! ```
//! impl Spec for AppSpec {
//! type Msg = Msg;
//! type Model = Model;
//!
//! fn init(&self, sh: &Shell<Self>) -> Init<Self> {
//! Init{
//! ..Default::default()
//! }
//! }
//! fn update(&self, model: &mut Model, msg: Msg, sh: &mut Shell<Self>) {
//! match msg {
//! Msg::NoOp => {}
//! Msg::Increment => {
//! let current = model.counter.get_copy();
//! model.counter.set(current + 1);
//! }
//! Msg::Decrement => {
//! let current = model.counter.get_copy();
//! model.counter.set(current - 1);
//! }
//! }
//! }
//! fn view(&self, model: &Model) -> View<Msg> {v1!{
//! display: "flex";
//! flex_direction: "column";
//! display: "flex";
//! flex_direction: "column";
//! max_width: "600px";
//! margin: "0 auto";
//! padding_top: "30px";
//!
//! css.media[max_width: "600px"] => s1!{
//! padding: "0 10px";
//! };
//!
//! h1 !{
//! text_theme();
//! margin: "0";
//! text_align: "center";
//! font_size: "6em";
//! margin_bottom: "10px";
//! color: "#777";
//! font_weight: "700";
//! transition: "1s";
//! css.hover => s1!{
//! font_size: "8em";
//! color: "#00fdde";
//! };
//! model.counter.map(|x| format!("{}", x));
//! };
//! button !{
//! text_theme();
//! outline: "none";
//! user_select: "none";
//! padding: "4px";
//! font_size: "2em";
//! border: "none";
//! border_radius: "3px";
//! background_color: "#565656";
//! color: "#fff";
//! margin_bottom: "10px";
//! event.click[] => move || Msg::Increment;
//! "Increment";
//! };
//! button !{
//! text_theme();
//! outline: "none";
//! user_select: "none";
//! padding: "4px";
//! font_size: "2em";
//! border: "none";
//! border_radius: "3px";
//! background_color: "#565656";
//! color: "#fff";
//! event.click[] => move || Msg::Decrement;
//! "Decrement";
//! };
//! }}
//! }
//! ```
// pub mod dev;
use *;
// #[wasm_bindgen]
// pub fn main() -> Result<(), wasm_bindgen::JsValue> {
// console_error_panic_hook::set_once();
// console!("started");
// // dev::cms_app::client::setup();
// // dev::todo_app::setup();
// Ok(())
// }
// #[wasm_bindgen]
// pub fn tick() {
// // dev::cms_app::client::tick();
// // dev::todo_app::tick();
// }