⚡️ (core): Registro de acciones inmutable

This commit is contained in:
Manuel Cillero 2026-09-26 00:56:30 +02:00
parent 5b2ddeb6cc
commit 58d1fef4f1
15 changed files with 624 additions and 244 deletions

View file

@ -117,10 +117,7 @@ impl DeclareAdminSections {
}
pub(crate) fn dispatch(bag: &mut SectionBag) {
dispatch_actions(
&ActionKey::new(UniqueId::of::<Self>(), None, None),
|action: &Self| (action.f)(bag),
);
dispatch_actions(|action: &Self| (action.f)(bag));
}
}
@ -173,10 +170,7 @@ impl DeclareAdminPages {
}
pub(crate) fn dispatch(bag: &mut PageBag) {
dispatch_actions(
&ActionKey::new(UniqueId::of::<Self>(), None, None),
|action: &Self| (action.f)(bag),
);
dispatch_actions(|action: &Self| (action.f)(bag));
}
}
@ -229,10 +223,7 @@ impl DeclareAdminTasks {
}
pub(crate) fn dispatch(bag: &mut TaskBag) {
dispatch_actions(
&ActionKey::new(UniqueId::of::<Self>(), None, None),
|action: &Self| (action.f)(bag),
);
dispatch_actions(|action: &Self| (action.f)(bag));
}
}
@ -283,9 +274,6 @@ impl DeclareAdminActions {
}
pub(crate) fn dispatch(bag: &mut ActionBag) {
dispatch_actions(
&ActionKey::new(UniqueId::of::<Self>(), None, None),
|action: &Self| (action.f)(bag),
);
dispatch_actions(|action: &Self| (action.f)(bag));
}
}

View file

@ -58,10 +58,7 @@ impl DeclarePermissions {
/// Despacha todas las acciones `DeclarePermissions` registradas construyendo el catálogo.
pub(crate) fn dispatch(registry: &mut PermissionRegistry) {
dispatch_actions(
&ActionKey::new(UniqueId::of::<Self>(), None, None),
|action: &Self| (action.handler)(registry),
);
dispatch_actions(|action: &Self| (action.handler)(registry));
}
}