🔥 Remove before/after_prepare_..() from components

This commit is contained in:
Manuel Cillero 2023-11-05 09:56:22 +01:00
parent e5db7ef6ad
commit 012fac2608

View file

@ -39,24 +39,15 @@ pub trait ComponentTrait: ComponentBase + HasHandle + Send + Sync {
true true
} }
#[allow(unused_variables)]
fn before_prepare_component(&mut self, cx: &mut Context) {}
#[allow(unused_variables)] #[allow(unused_variables)]
fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup { fn prepare_component(&self, cx: &mut Context) -> PrepareMarkup {
PrepareMarkup::None PrepareMarkup::None
} }
#[allow(unused_variables)]
fn after_prepare_component(&mut self, cx: &mut Context) {}
} }
impl<C: ComponentTrait> ComponentBase for C { impl<C: ComponentTrait> ComponentBase for C {
fn render(&mut self, cx: &mut Context) -> Markup { fn render(&mut self, cx: &mut Context) -> Markup {
if self.is_renderable(cx) { if self.is_renderable(cx) {
// Acciones antes de preparar el componente.
self.before_prepare_component(cx);
// Acciones del tema antes de preparar el componente. // Acciones del tema antes de preparar el componente.
cx.theme().before_prepare_component(self, cx); cx.theme().before_prepare_component(self, cx);
@ -76,9 +67,6 @@ impl<C: ComponentTrait> ComponentBase for C {
}, },
}; };
// Acciones después de preparar el componente.
self.after_prepare_component(cx);
// Acciones del tema después de preparar el componente. // Acciones del tema después de preparar el componente.
cx.theme().after_prepare_component(self, cx); cx.theme().after_prepare_component(self, cx);