Selaa lähdekoodia

fermi: set atom value even it doesn't exist

Yin Jifeng 3 vuotta sitten
vanhempi
commit
c97f051bbd
1 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  1. 7 0
      packages/fermi/src/root.rs

+ 7 - 0
packages/fermi/src/root.rs

@@ -74,6 +74,13 @@ impl AtomRoot {
             }
         } else {
             log::trace!("no atoms found for {:?}", ptr);
+            atoms.insert(
+                ptr,
+                Slot {
+                    value: Rc::new(value),
+                    subscribers: HashSet::new(),
+                },
+            );
         }
     }