Skip to content

Commit

Permalink
🧪 Some idea.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed May 5, 2024
1 parent d7a1a45 commit f343d97
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/boot/tests/isomorphism_component.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#![allow(dead_code)]
#![allow(non_snake_case)]

#[cfg(test)]
mod test {
#[at(client)]
#[styled_component]
pub fn FetchButton() -> Html {
let result = use_state(|| "Click me".to_string());

html! {
<button onclick={{
let result = result.clone();
move |_| {
if let Ok(response) = on!(server, (*result).clone(), async |result, global_memory| {
global_memory.get("count")? += 1;
Ok(format!("{} | {}", result, global_memory.get("count")?))
}) {
*result = response;
}
}
}}>
{*result}
</button>
}
}
}

0 comments on commit f343d97

Please sign in to comment.