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

+6 -2
View File
@@ -86,8 +86,12 @@ fn current_owner<S: Storage<T>, T>() -> Owner<S> {
}
// Otherwise get the owner from the current reactive context.
let current_reactive_context = ReactiveContext::current();
owner_in_scope(current_reactive_context.origin_scope())
match ReactiveContext::current(){
Some(current_reactive_context) => owner_in_scope(current_reactive_context.origin_scope()),
None => {
owner_in_scope(current_scope_id().expect("in a virtual dom"))
}
}
}
fn owner_in_scope<S: Storage<T>, T>(scope: ScopeId) -> Owner<S> {