To get around the inability to work with a subscription with an argument in version 0.13, I tried version 0.14-dev.
But in 0.14.0 dev application have bootfn, that can’t hold || self as arg, so there no way to pass config to boot fn.
So to make simple init of state, seems is should make something like new(conf0, conf1, …), than copy it’s result into global mutable, and than make bootfn, that just access the global mutable?
Or there is any other way to make application that do not want bootfn and can just take state?
If you’re sure you can’t just create any config in your bootfn, you can clone/copy data to adhere to FnOnce requirements. So move || App::new(config.clone()) should work, for example.
That, or use an Arc if you don’t need ownership of it. - i need to take receiver and some other stuff, that shold not be inside arc and e.t.c
i just need to make:
let app = iced::application(|| self, Self::update, Self::view)
.theme(Theme::Dark)
.subscription(|a| a.subscription());
//app.run_with(move || (self, iced::Task::none())) - work well in 0.13.0
app.run();