-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Widget::Action
associated type
#664
Comments
To clarify, this would mean that the action type is always downcasted? That seems reasonable to me. I think Xilem would be able to make use of this for a slight ease-of-use improvement. |
Basically yes. |
This idea seemed great to me at first, but I'm not sure I really see how/why it would be used. Actions would still be |
I think it's because |
During various passes, widgets that want to signal a semantically meaningful event from the UI (eg a button that was clicked) can emit actions.
Actions are a centralized queue of messages intended for the root application, mostly for the app driver (eg Xilem) to handle. They are inspired by Facebook's Flux architecture.
Actions are currently under-designed. Right now, they only store the emitter's id, plus a payload among a small set of types with
Box<dyn Any>
as a wildcard. Ideally, we'd want a way to connect the type of an action from the widget that sent it, so that each widget would have an associated action type. This associated type would only exist for sized Widgets so that the trait remains dyn-safe.The text was updated successfully, but these errors were encountered: