diff options
author | 2025-06-02 21:16:18 +0100 | |
---|---|---|
committer | 2025-06-02 21:16:18 +0100 | |
commit | 4a5aa6579f5184c443ffbe80ce93e0daa0926826 (patch) | |
tree | c1c2e71dc7765403ae0a3670d50eaaf158b24786 /src/state_store.rs | |
parent | ab654372e4d3766c8df17623a6de8922fc2a1960 (diff) | |
download | macaw-web-4a5aa6579f5184c443ffbe80ce93e0daa0926826.tar.gz macaw-web-4a5aa6579f5184c443ffbe80ce93e0daa0926826.tar.bz2 macaw-web-4a5aa6579f5184c443ffbe80ce93e0daa0926826.zip |
Diffstat (limited to 'src/state_store.rs')
-rw-r--r-- | src/state_store.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/state_store.rs b/src/state_store.rs index 8d80b3f..ac90e40 100644 --- a/src/state_store.rs +++ b/src/state_store.rs @@ -1,6 +1,7 @@ use std::{collections::HashMap, ops::{Deref, DerefMut}, sync::{Arc, RwLock}}; use leptos::prelude::*; +use tracing::debug; // TODO: get rid of this // V has to be an arc signal @@ -105,7 +106,7 @@ impl<K, V, S> Clone for StateStore<K, V, S> { } } -impl<K: Eq + std::hash::Hash + Clone, V: Clone> StateStore<K, V> +impl<K: Eq + std::hash::Hash + Clone + std::fmt::Debug, V: Clone + std::fmt::Debug> StateStore<K, V> where K: Send + Sync + 'static, V: Send + Sync + 'static, @@ -114,7 +115,9 @@ where { let store = self.inner.try_get_value().unwrap(); let mut store = store.store.write().unwrap(); + debug!("store state: {:?}", store); if let Some((v, count)) = store.get_mut(&key) { + debug!("updating old value already in store"); v.set(value); *count += 1; StateListener { @@ -127,6 +130,7 @@ where } else { let v = ArcRwSignal::new(value); store.insert(key.clone(), (v.clone(), 1)); + debug!("inserting new value: {:?}", store); StateListener { value: v.into(), cleaner: StateCleaner { |