|
|
@ -1,8 +1,6 @@
|
|
|
|
use seed::{*, prelude::*};
|
|
|
|
use seed::{*, prelude::*};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct Model {
|
|
|
|
struct Model {
|
|
|
|
pub val: i32,
|
|
|
|
pub val: i32,
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -16,8 +14,6 @@ impl Default for Model {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
#[derive(Clone)]
|
|
|
|
enum Msg {
|
|
|
|
enum Msg {
|
|
|
|
Increment,
|
|
|
|
Increment,
|
|
|
@ -30,8 +26,6 @@ fn update(msg: Msg, model: &mut Model, _: &mut impl Orders<Msg>) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// View
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn view(model: &Model) -> impl View<Msg> {
|
|
|
|
fn view(model: &Model) -> impl View<Msg> {
|
|
|
|
button![
|
|
|
|
button![
|
|
|
|
simple_ev(Ev::Click, Msg::Increment),
|
|
|
|
simple_ev(Ev::Click, Msg::Increment),
|
|
|
|