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
13
14
//! `Reverse` of lists (`List/ObservableListEx.Reverse.cs`).

macro_rules! reverse_methods {
    () => {
        /// The changes of the list in reverse order (`Reverse`).
        fn reverse(&self) -> std::rc::Rc<dyn ferroui_system::IObservable<crate::list::ChangeSet<T>>> {
            let reverser = std::cell::RefCell::new(crate::list::internal::Reverser::default());
            ferroui_reactive::ObservableExt::select(&self.change_sets(), move |changes: crate::list::ChangeSet<T>| {
                crate::list::ChangeSet::from(reverser.borrow_mut().reverse(&changes))
            })
        }
    };
}
pub(crate) use reverse_methods;