Skip to content

Commit

Permalink
update to latest respo with simpler alias
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Oct 27, 2024
1 parent 3cac8a0 commit 7a36d06
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
4 changes: 2 additions & 2 deletions moon.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "tiye/respo-workflow",
"version": "0.1.0",
"deps": {
"tiye/respo": "0.0.6",
"tiye/dom-ffi": "0.0.3"
"tiye/respo": "0.0.9",
"tiye/dom-ffi": "0.0.4"
},
"readme": "README.md",
"repository": "",
Expand Down
31 changes: 9 additions & 22 deletions src/main/counter.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,20 @@ fn comp_counter(
@respo_node.div(
[
@respo_node.button(
attrs=@respo_node.respo_attrs(
inner_text="demo inc",
class_name=@respo.ui_button,
),
inner_text="demo inc",
class_name=@respo.ui_button,
style=@respo_node.RespoStyle::new(margin=Px(4)),
event={}..set(Click, on_inc),
),
@respo_node.button(
attrs=@respo_node.respo_attrs(
inner_text="demo dec",
class_name=@respo.ui_button,
),
inner_text="demo dec",
class_name=@respo.ui_button,
style=@respo_node.RespoStyle::new(margin=Px(4)),
event={}..set(Click, on_dec),
),
@respo_node.button(
attrs=@respo_node.respo_attrs(
inner_text="demo inc twice",
class_name=@respo.ui_button,
),
inner_text="demo inc twice",
class_name=@respo.ui_button,
style=@respo_node.RespoStyle::new(margin=Px(4)),
event={}..set(Click, on_inc_twice),
),
Expand All @@ -87,9 +81,7 @@ fn comp_counter(
@respo_node.div(
[
@respo_node.span(
attrs=@respo_node.respo_attrs(
inner_text="value is: " + counted.to_string(),
),
inner_text="value is: " + counted.to_string(),
style=@respo_node.RespoStyle::new(
color=Hsluv(270, 100, 40),
font_family="Menlo",
Expand All @@ -101,15 +93,10 @@ fn comp_counter(
),
@respo_node.div(
[
@respo_node.span(
attrs=@respo_node.respo_attrs(inner_text="local state: \{counted}"),
[],
),
@respo_node.span(inner_text="local state: \{counted}", []),
@respo_node.br(),
@respo_node.span(
attrs=@respo_node.respo_attrs(
inner_text="global state: " + global_counted.to_string(),
),
inner_text="global state: " + global_counted.to_string(),
[],
),
],
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn App::view(
// @dom_ffi.log("Store to render: " + store.to_json().stringify(indent=2))
let states = store.get_states()
@respo_node.div(
attrs=@respo_node.respo_attrs(class_name=@respo.ui_global),
class_name=@respo.ui_global,
style=@respo_node.RespoStyle::new(padding=Px(12)),
[comp_counter(states.pick("counter"), store.counted)],
)
Expand Down

0 comments on commit 7a36d06

Please sign in to comment.