ferroui-dynamic-data 0.3.0

A port of DynamicData for FerroUI: reactive collections, change sets, observable caches and lists with their operators, independent of the user interface
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! `Watch` (`Cache/ObservableCacheEx.Watch.cs`).

macro_rules! watch_methods {
    () => {
        /// The changes of the item of `key` (`Watch(IObservable<IChangeSet>, TKey)`).
        fn watch(&self, key: K) -> std::rc::Rc<dyn ferroui_system::IObservable<crate::cache::Change<T, K>>> {
            let changes = ferroui_reactive::ObservableExt::select_many_iter(&self.change_sets(), |updates: crate::cache::ChangeSet<T, K>| updates.to_vec());
            ferroui_reactive::ObservableExt::where_(&changes, move |update: &crate::cache::Change<T, K>| *update.key() == key)
        }
    };
}
pub(crate) use watch_methods;