Skip to main content

euv_core/reactive/selector/
struct.rs

1use super::*;
2
3/// O(1) keyed reactive selector notifying only the previously selected and newly selected keys.
4#[derive(CustomDebug)]
5pub struct Selector<K>
6where
7    K: Clone + Eq + Hash + 'static,
8{
9    /// Active key value mirror.
10    #[debug(skip)]
11    pub(crate) active: Rc<RefCell<Option<K>>>,
12    /// Per-key boolean selection signals.
13    #[debug(skip)]
14    pub(crate) subscribers: Rc<RefCell<HashMap<K, Signal<bool>>>>,
15    /// Effect watching the source key producer.
16    pub(crate) watcher: Effect,
17}