🚧 Working on actions system

This commit is contained in:
Manuel Cillero 2024-03-25 17:38:39 +01:00
parent 2ea0a1698e
commit e732244a2e
15 changed files with 165 additions and 153 deletions

View file

@ -47,7 +47,7 @@ impl<C: ComponentTrait> AfterPrepareComponent<C> {
pub(crate) fn dispatch(component: &mut C, cx: &mut Context, referer_id: Option<String>) {
dispatch_actions(
(TypeId::of::<Self>(), Some(TypeId::of::<C>()), referer_id),
|action| (action_ref::<AfterPrepareComponent<C>>(&**action).f)(component, cx),
|action: &Self| (action.f)(component, cx),
);
}
}

View file

@ -47,7 +47,7 @@ impl<C: ComponentTrait> BeforePrepareComponent<C> {
pub(crate) fn dispatch(component: &mut C, cx: &mut Context, referer_id: Option<String>) {
dispatch_actions(
(TypeId::of::<Self>(), Some(TypeId::of::<C>()), referer_id),
|action| (action_ref::<BeforePrepareComponent<C>>(&**action).f)(component, cx),
|action: &Self| (action.f)(component, cx),
);
}
}

View file

@ -25,8 +25,8 @@ impl AfterPrepareBody {
#[inline(always)]
pub(crate) fn dispatch(page: &mut Page) {
dispatch_actions((TypeId::of::<Self>(), None, None), |action| {
(action_ref::<AfterPrepareBody>(&**action).f)(page)
dispatch_actions((TypeId::of::<Self>(), None, None), |action: &Self| {
(action.f)(page)
});
}
}

View file

@ -25,8 +25,8 @@ impl BeforePrepareBody {
#[inline(always)]
pub(crate) fn dispatch(page: &mut Page) {
dispatch_actions((TypeId::of::<Self>(), None, None), |action| {
(action_ref::<BeforePrepareBody>(&**action).f)(page)
dispatch_actions((TypeId::of::<Self>(), None, None), |action: &Self| {
(action.f)(page)
});
}
}