lazy_load: Add the ability to execute a callbakc on finish
When iteration of data is finished, None will be returned and the or_else() block will be executed. Now a callback can be passed that will be executd when the iteration/loading finishes.
This commit is contained in:
@@ -399,9 +399,11 @@ pub fn episodes_listbox(pd: Arc<Podcast>, sender: Sender<Action>) -> Result<gtk:
|
||||
Err(Disconnected) => return glib::Continue(false),
|
||||
};
|
||||
|
||||
lazy_load(episodes, list.clone(), clone!(sender => move |ep| {
|
||||
let constructor = clone!(sender => move |ep| {
|
||||
EpisodeWidget::new(ep, sender.clone()).container
|
||||
}));
|
||||
});
|
||||
|
||||
lazy_load(episodes, list.clone(), constructor, || {});
|
||||
|
||||
glib::Continue(false)
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user