mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-12 23:57:09 +00:00
parent
08ad6832af
commit
f46084723a
2 changed files with 47 additions and 37 deletions
|
@ -132,7 +132,7 @@ pub fn render_to_stream_with_prefix_undisposed_with_context(
|
|||
let (
|
||||
(shell, prefix, pending_resources, pending_fragments, serializers),
|
||||
scope,
|
||||
_,
|
||||
disposer,
|
||||
) = run_scope_undisposed(runtime, {
|
||||
move |cx| {
|
||||
// Add additional context items
|
||||
|
@ -209,7 +209,12 @@ pub fn render_to_stream_with_prefix_undisposed_with_context(
|
|||
// TODO these should be combined again in a way that chains them appropriately
|
||||
// such that individual resources can resolve before all fragments are done
|
||||
.chain(fragments)
|
||||
.chain(resources);
|
||||
.chain(resources)
|
||||
// dispose of the root scope
|
||||
.chain(futures::stream::once(async move {
|
||||
disposer.dispose();
|
||||
Default::default()
|
||||
}));
|
||||
|
||||
(stream, runtime, scope)
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ pub fn render_to_stream_in_order_with_prefix_undisposed_with_context(
|
|||
// create the runtime
|
||||
let runtime = create_runtime();
|
||||
|
||||
let ((chunks, prefix, pending_resources, serializers), scope_id, _) =
|
||||
let ((chunks, prefix, pending_resources, serializers), scope_id, disposer) =
|
||||
run_scope_undisposed(runtime, |cx| {
|
||||
// add additional context
|
||||
additional_context(cx);
|
||||
|
@ -111,7 +111,12 @@ pub fn render_to_stream_in_order_with_prefix_undisposed_with_context(
|
|||
)
|
||||
})
|
||||
.chain(rx)
|
||||
.chain(render_serializers(serializers));
|
||||
.chain(render_serializers(serializers))
|
||||
// dispose of the scope
|
||||
.chain(futures::stream::once(async move {
|
||||
disposer.dispose();
|
||||
Default::default()
|
||||
}));
|
||||
|
||||
(stream, runtime, scope_id)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue