better global state structure?

This commit is contained in:
2025-12-19 21:54:48 -05:00
parent 30bc55c78e
commit bae17235c6
23 changed files with 335 additions and 230 deletions

View File

@@ -28,11 +28,14 @@ impl<E: Event> EventLike for E {
}
}
pub trait EventFn<State, Data>: Fn(EventCtx<State, Data>) + 'static {}
impl<State, F: Fn(EventCtx<State, Data>) + 'static, Data> EventFn<State, Data> for F {}
pub trait EventFn<State, Data>: Fn(&mut EventCtx<State, Data>) + 'static {}
impl<State, F: Fn(&mut EventCtx<State, Data>) + 'static, Data> EventFn<State, Data> for F {}
pub trait WidgetEventFn<State, Data, W: ?Sized>: Fn(EventIdCtx<State, Data, W>) + 'static {}
impl<State, F: Fn(EventIdCtx<State, Data, W>) + 'static, Data, W: ?Sized>
pub trait WidgetEventFn<State, Data, W: ?Sized>:
Fn(&mut EventIdCtx<State, Data, W>) + 'static
{
}
impl<State, F: Fn(&mut EventIdCtx<State, Data, W>) + 'static, Data, W: ?Sized>
WidgetEventFn<State, Data, W> for F
{
}