Skip to content

Commit

Permalink
fix: Resource::refetch()
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj committed Sep 9, 2024
1 parent 5a57d48 commit 6baf202
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions leptos_server/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ where
let is_ready = initial.is_some();

let refetch = ArcRwSignal::new(0);
let source = ArcMemo::new(move |_| source());
let source = ArcMemo::new({
let refetch = refetch.clone();
move |_| (refetch.get(), source())
});
let fun = {
let source = source.clone();
let refetch = refetch.clone();
move || {
refetch.track();
fetcher(source.get())
let (_, source) = source.get();
fetcher(source)
}
};

Expand Down

0 comments on commit 6baf202

Please sign in to comment.