Skip to content

Commit

Permalink
use_prepared_state_with_suspension needs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ranile committed Aug 14, 2023
1 parent 0229ac9 commit 55683ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ where
fn run(self, ctx: &mut HookContext) -> Self::Output {
match ctx.creation_mode {
RenderMode::Ssr => {
feat_ssr::use_prepared_state_with_suspension(self.f, self.deps).run(ctx)
feat_ssr::use_prepared_state_with_suspension(self.deps, self.f).run(ctx)
}
_ => feat_hydration::use_prepared_state(self.deps).run(ctx),
}
Expand Down
9 changes: 3 additions & 6 deletions tools/benchmark-ssr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,9 @@ async fn bench_concurrent_task() -> Duration {

#[function_component]
fn Comp() -> HtmlResult {
let _state = use_prepared_state!(
(),
async move |_| -> () {
sleep(Duration::from_secs(1)).await;
}
)?;
let _state = use_prepared_state!((), async move |_| -> () {
sleep(Duration::from_secs(1)).await;
})?;

Ok(Html::default())
}
Expand Down

0 comments on commit 55683ce

Please sign in to comment.