don't subscribe in tasks or event handlers

This commit is contained in:
Evan Almloff committed 2023-08-07 17:55:29 -07:00
1 parent 4447709ac8
commit 0c17bdb737
6 files changed
+35 -16

No files matched your search

+6
View File
@@ -263,6 +263,12 @@ pub fn current_scope_id() -> Option<ScopeId> {
with_runtime(|rt| rt.current_scope_id()).flatten()
}
#[doc(hidden)]
/// Check if the virtual dom is currently inside of the body of a component
pub fn vdom_is_rendering() -> bool {
with_runtime(|rt| rt.rendering.get()).unwrap_or_default()
}
/// Consume context from the current scope
pub fn consume_context<T: 'static + Clone>() -> Option<T> {
with_current_scope(|cx| cx.consume_context::<T>()).flatten()