macro_rules! when_value_changed_methods {
() => {
fn when_value_changed<P: crate::binding::IntoPropertyChain<T>>(&self, property_accessor: P) -> std::rc::Rc<dyn ferroui_system::IObservable<P::Value>>
where
P::Value: 'static,
{
self.when_value_changed_with(property_accessor, true)
}
fn when_value_changed_with<P: crate::binding::IntoPropertyChain<T>>(
&self,
property_accessor: P,
notify_on_initial_value: bool,
) -> std::rc::Rc<dyn ferroui_system::IObservable<P::Value>>
where
P::Value: 'static,
{
let chain = crate::binding::IntoPropertyChain::into_property_chain(property_accessor);
crate::cache::internal::merge_item_observables(
self.change_sets(),
std::rc::Rc::new(move |item: &T, _: &K| crate::binding::when_changed_of(chain.clone(), item.clone(), notify_on_initial_value, None)),
)
}
};
}
pub(crate) use when_value_changed_methods;