macro_rules! ignore_update_when_methods {
() => {
fn ignore_update_when(
&self,
ignore_function: impl Fn(&T, &T) -> bool + 'static,
) -> std::rc::Rc<dyn ferroui_system::IObservable<crate::cache::ChangeSet<T, K>>> {
let selected = ferroui_reactive::ObservableExt::select(&self.change_sets(), move |updates: crate::cache::ChangeSet<T, K>| {
updates
.iter()
.filter(|update| {
if update.reason() != crate::cache::ChangeReason::Update {
return true;
}
!ignore_function(update.current(), update.previous().expect("an update has a previous item"))
})
.cloned()
.collect::<crate::cache::ChangeSet<T, K>>()
});
crate::cache::ObservableCacheEx::<T, K>::not_empty(&selected)
}
};
}
pub(crate) use ignore_update_when_methods;