use transition between navigations

This commit is contained in:
Greg Johnston 2024-05-20 13:38:16 -04:00
parent 5e16ae6a26
commit 3814879d80

View file

@ -15,7 +15,7 @@ use reactive_graph::{
computed::{ArcMemo, Memo, ScopedFuture},
owner::{provide_context, use_context, Owner},
signal::{ArcRwSignal, ArcTrigger},
traits::{Get, GetUntracked, Read, ReadUntracked, Set, Track, Trigger},
traits::{Get, GetUntracked, Read, ReadUntracked, Set, Track, Trigger}, transition::AsyncTransition,
};
use std::{
borrow::Cow,
@ -367,8 +367,7 @@ where
async move {
provide_context(url);
provide_context(params);
// TODO if we want, we could resolve() this here to wait for data to load
let view = view.choose().await;
let view = AsyncTransition::run(|| view.choose()).await;
// only update the route if it's still the current path
// i.e., if we've navigated away before this has loaded, do nothing