-
Notifications
You must be signed in to change notification settings - Fork 66
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
Refactor launcher #1573
base: master
Are you sure you want to change the base?
Refactor launcher #1573
Conversation
@@ -0,0 +1,36 @@ | |||
pub(super) mod prelude { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm no module expert - so most likely this can be improved.
.padding(100) | ||
} | ||
|
||
fn with_children<'a>(&'a self, content: Element<'a, Message>) -> Element<'a, Message> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not elide those lifetimes, maybe someone else knows better....
) | ||
} | ||
|
||
fn view_no_wallet(&self) -> Column<ViewMessage> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
view_no_wallet
could probably be split even more.
) | ||
} | ||
|
||
fn view_wallet( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
view_wallet
could probably be split even more.
Deleted, | ||
} | ||
|
||
pub(super) struct DeleteWalletModal { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DeleteWalletModal can be split out too, into children
module of launcher
module.
} | ||
} | ||
|
||
fn handle_view(&mut self, view_message: ViewMessage) -> Option<Task<Message>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full exhaustive, less indented handling of ViewMessages only
Note
This is an opinionated refactoring of the
Launcher
feature - I completely understand if you dislike/hatethis style!
I'm new to GUI in Rust and Iced - but I've developed Redux styled applications in SwiftUI using TCA for many years, where it is quite a common pattern to split:
update
methods into smaller sub-update methodsWhich is what I've done in this PR - mostly to ask for input if it is something you as maintainers of Liana or the ICED community in large likes?
Tip
The advantages of this approach is two fold:
Other changes