Allow passing external state to Application::new

This commit is contained in:
Héctor Ramón Jiménez 2020-03-30 18:00:15 +02:00
parent 6e9ab1cd6f
commit c4c5216e3b
13 changed files with 103 additions and 60 deletions

View file

@ -29,8 +29,9 @@ enum Message {
impl Application for Pokedex {
type Executor = iced::executor::Default;
type Message = Message;
type Flags = ();
fn new() -> (Pokedex, Command<Message>) {
fn new(_flags: ()) -> (Pokedex, Command<Message>) {
(
Pokedex::Loading,
Command::perform(Pokemon::search(), Message::PokemonFound),