only subscribe scopes to signals when rendering

This commit is contained in:
Evan Almloff committed 2024-02-14 09:33:22 -06:00
1 parent 49f3b8235d
commit 48751d2f98
14 files changed
+424 -48

No files matched your search

+1 -1
View File
@@ -33,7 +33,7 @@ impl<T: PartialEq + 'static> GlobalMemo<T> {
None => {
drop(read);
// Constructors are always run in the root scope
let signal = ScopeId::ROOT.in_runtime(|| Signal::selector(self.selector));
let signal = ScopeId::ROOT.in_runtime(|| Signal::memo(self.selector));
context.signal.borrow_mut().insert(key, Box::new(signal));
signal
}