-
-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
enhancementNew feature or requestNew feature or request
Description
In particular, components should be able to dispatch events, and subscribers should be able to choose to either consume them or give another subscriber a chance to handle them.
This could look something like...
hooks.use_events<MyEvent>(|e| {
if ... {
// handle the event
e.stop_propagation();
}
});Somewhere else...
let dispatcher = hooks.use_event_dispatcher<MyEvent>();dispatcher.dispatch(MyEvent::new(...));Unless stop_propagate is called on the event, the event would bubble up the chain of parent elements with event handlers for that type.
This mechanism could potentially replace the current use_terminal_events hook, if for keystroke events we also had a mechanism to define a focus or "first responder" to which they would be dispatched initially.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request