unbox component functions
This commit is contained in:
1 parent
98bd78de43
commit
ef553a2cb2
4 files changed
+20
-14
No files matched your search
@@ -13,7 +13,7 @@ use crate::{
|
||||
nodes::{Template, TemplateId},
|
||||
runtime::{Runtime, RuntimeGuard},
|
||||
scopes::ScopeId,
|
||||
AttributeValue, Element, Event, Mutations,
|
||||
AttributeValue, BoxedContext, Element, Event, Mutations,
|
||||
};
|
||||
use futures_util::{pin_mut, StreamExt};
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
@@ -328,8 +328,10 @@ impl VirtualDom {
|
||||
/// Build the virtualdom with a global context inserted into the base scope
|
||||
///
|
||||
/// This method is useful for when you want to provide a context in your app without knowing its type
|
||||
pub fn with_boxed_root_context(self, context: Box<dyn Any>) -> Self {
|
||||
self.base_scope().context().provide_any_context(context);
|
||||
pub fn with_boxed_root_context(self, context: BoxedContext) -> Self {
|
||||
self.base_scope()
|
||||
.context()
|
||||
.provide_any_context(context.into_inner());
|
||||
self
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user