Skip to content

Commit

Permalink
fix: remove non-essential Stateful methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanceras committed Mar 9, 2024
1 parent bee50ef commit e11cd21
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 30 deletions.
4 changes: 2 additions & 2 deletions examples/experimentals/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ impl Application<Msg> for App {
{Component::view(&self.btn).map_msg(Msg::BtnMsg)}
</div>
<div>
{component::<Button, Msg, button::Msg>([], [text("External child of btn component")])}
{component(Button::default(), [], [text("External child of btn component")])}
</div>
<div>
{component::<DateTimeWidget<()>, Msg, date_time::Msg>([],[text("External child of date widget")])}
{component(DateTimeWidget::default(), [],[text("External child of date widget")])}
</div>
</div>
}
Expand Down
16 changes: 0 additions & 16 deletions examples/experimentals/src/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ impl StatefulComponent for Button {
{
}

fn template(&self) -> web_sys::Node {
template::build_template(&Component::view(self))
}

/// remove the attribute with this name
fn remove_attribute(&mut self, attr_name: AttributeName) {}

/// append a child into this component
fn append_child(&mut self, child: &web_sys::Node) {
Expand All @@ -89,14 +83,4 @@ impl StatefulComponent for Button {
}
}

/// remove a child in this index
fn remove_child(&mut self, index: usize) {}

/// the component is attached to the dom
fn connected_callback(&mut self) {}
/// the component is removed from the DOM
fn disconnected_callback(&mut self) {}

/// the component is moved or attached to the dom
fn adopted_callback(&mut self) {}
}
12 changes: 0 additions & 12 deletions examples/experimentals/src/date_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ impl StatefulComponent for DateTimeWidget<()> {
DateTimeWidget::default()
}

fn template(&self) -> web_sys::Node {
template::build_template(&Component::view(self))
}

/// this is called when the attributes in the mount is changed
fn attribute_changed(
Expand Down Expand Up @@ -262,15 +259,6 @@ impl StatefulComponent for DateTimeWidget<()> {
}
}

fn remove_attribute(&mut self, attr_name: AttributeName) {}

fn remove_child(&mut self, index: usize) {}

fn connected_callback(&mut self) {}

fn disconnected_callback(&mut self) {}

fn adopted_callback(&mut self) {}
}

#[wasm_bindgen]
Expand Down

0 comments on commit e11cd21

Please sign in to comment.