Skip to content

Commit

Permalink
#53 Don't use Context directly
Browse files Browse the repository at this point in the history
  • Loading branch information
wtholliday committed Dec 13, 2023
1 parent 22d7e57 commit 46adc11
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ use rui::*;
fn main() {
rui(state(
|| 1,
|count, cx| {
|count, _| {
vstack((
cx[count].padding(Auto),
button("increment", move |cx| {
cx[count] += 1;
(*count).padding(Auto),
button("increment", move |_| {
let mut c = count;
*c += 1;
})
.padding(Auto),
))
Expand Down

0 comments on commit 46adc11

Please sign in to comment.