mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
Update SSR benchmark code to new APIs
This commit is contained in:
parent
b9e8777bb1
commit
109863c59a
2 changed files with 8 additions and 6 deletions
|
@ -7,7 +7,7 @@ fn leptos_ssr_bench(b: &mut Bencher) {
|
|||
|
||||
_ = create_scope(create_runtime(), |cx| {
|
||||
#[component]
|
||||
fn Counter(cx: Scope, initial: i32) -> View {
|
||||
fn Counter(cx: Scope, initial: i32) -> impl IntoView {
|
||||
let (value, set_value) = create_signal(cx, initial);
|
||||
view! {
|
||||
cx,
|
||||
|
|
|
@ -103,7 +103,7 @@ const ESCAPE_KEY: u32 = 27;
|
|||
const ENTER_KEY: u32 = 13;
|
||||
|
||||
#[component]
|
||||
pub fn TodoMVC(cx: Scope, todos: Todos) -> View {
|
||||
pub fn TodoMVC(cx: Scope, todos: Todos) -> impl IntoView {
|
||||
let mut next_id = todos
|
||||
.0
|
||||
.iter()
|
||||
|
@ -186,9 +186,11 @@ pub fn TodoMVC(cx: Scope, todos: Todos) -> View {
|
|||
/>
|
||||
<label for="toggle-all">"Mark all as complete"</label>
|
||||
<ul class="todo-list">
|
||||
<For each=filtered_todos key=|todo| todo.id>
|
||||
{move |todo: Todo| view! { cx, <Todo todo=todo.clone() /> }}
|
||||
</For>
|
||||
<For
|
||||
each=filtered_todos
|
||||
key=|todo| todo.id
|
||||
view=move |todo: Todo| view! { cx, <Todo todo=todo.clone() /> }
|
||||
/>
|
||||
</ul>
|
||||
</section>
|
||||
<footer class="footer" class:hidden={move || todos.with(|t| t.is_empty())}>
|
||||
|
@ -225,7 +227,7 @@ pub fn TodoMVC(cx: Scope, todos: Todos) -> View {
|
|||
}
|
||||
|
||||
#[component]
|
||||
pub fn Todo(cx: Scope, todo: Todo) -> View {
|
||||
pub fn Todo(cx: Scope, todo: Todo) -> impl IntoView {
|
||||
let (editing, set_editing) = create_signal(cx, false);
|
||||
let set_todos = use_context::<WriteSignal<Todos>>(cx).unwrap();
|
||||
//let input = NodeRef::new(cx);
|
||||
|
|
Loading…
Reference in a new issue