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

@@ -3,7 +3,7 @@ use crate::prelude::*;
pub mod eventable {
use super::*;
widget_trait! {
pub trait Eventable<State: HasUi + HasEvents>;
pub trait Eventable<State: HasEvents + 'static>;
fn on<E: EventLike>(
self,
event: E,
@@ -12,7 +12,7 @@ pub mod eventable {
move |state| {
let id = self.handles(state);
state.register_event(id.r, event.into_event(), move |ctx| {
f(EventIdCtx {
f(&mut EventIdCtx {
widget: id.r,
state: ctx.state,
data: ctx.data,