Move the history provider into the context (#3048)
* move history providers into a separate crate * start moving route providers into the renderers * clean up intoroutable * remove into routable * fix router tests * Provide history providers in each renderer * implement nested routers * move the lens out of the history crate * re-export dioxus history trait in the prelude * also re-export the history function * fix history doctests * some light cleanups --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
1 parent
e5a1a62644
commit
281087469a
48 files changed
+875
-1419
No files matched your search
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
document::init_document,
|
||||
element::LiveviewElement,
|
||||
eval::init_eval,
|
||||
events::SerializedHtmlEventConverter,
|
||||
query::{QueryEngine, QueryResult},
|
||||
LiveViewError,
|
||||
@@ -130,9 +130,9 @@ pub async fn run(mut vdom: VirtualDom, ws: impl LiveViewSocket) -> Result<(), Li
|
||||
// Create the a proxy for query engine
|
||||
let (query_tx, mut query_rx) = tokio::sync::mpsc::unbounded_channel();
|
||||
let query_engine = QueryEngine::new(query_tx);
|
||||
vdom.in_runtime(|| {
|
||||
ScopeId::ROOT.provide_context(query_engine.clone());
|
||||
init_eval();
|
||||
vdom.runtime().on_scope(ScopeId::ROOT, || {
|
||||
provide_context(query_engine.clone());
|
||||
init_document();
|
||||
});
|
||||
|
||||
// pin the futures so we can use select!
|
||||
|
||||
Reference in new issue
Block a user