🚧 Working on actions system
This commit is contained in:
parent
2ea0a1698e
commit
e732244a2e
15 changed files with 165 additions and 153 deletions
|
|
@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue