renamed `Each` to `EachKey`
This commit is contained in:
parent
b1987648cf
commit
da1916e35a
|
@ -29,7 +29,7 @@ fn main() {
|
|||
fn view_fn(cx: Scope) -> impl IntoNode {
|
||||
let (count, set_count) = create_signal(cx, 0);
|
||||
let (show, set_show) = create_signal(cx, true);
|
||||
let (iterable, set_iterable) = create_signal(cx, vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
||||
let (iterable, set_iterable) = create_signal(cx, vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0]);
|
||||
|
||||
wasm_bindgen_futures::spawn_local(async move { set_count.update(|c| *c += 1) });
|
||||
|
||||
|
@ -42,6 +42,6 @@ fn view_fn(cx: Scope) -> impl IntoNode {
|
|||
.into_node(cx),
|
||||
h1().dyn_child(move || text(count().to_string()))
|
||||
.into_node(cx),
|
||||
Each::new(iterable, |i| *i, |i| h2().child(text(i.to_string()))).into_node(cx),
|
||||
EachKey::new(iterable, |i| *i, |i| h2().child(text(i.to_string()))).into_node(cx),
|
||||
]
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ impl EachItem {
|
|||
struct EachProps {}
|
||||
|
||||
/// A component for efficiently rendering an iterable.
|
||||
pub struct Each<IF, I, T, EF, N, KF, K>
|
||||
pub struct EachKey<IF, I, T, EF, N, KF, K>
|
||||
where
|
||||
IF: Fn() -> I + 'static,
|
||||
I: IntoIterator<Item = T>,
|
||||
|
@ -179,7 +179,7 @@ where
|
|||
key_fn: KF,
|
||||
}
|
||||
|
||||
impl<IF, I, T, EF, N, KF, K> Each<IF, I, T, EF, N, KF, K>
|
||||
impl<IF, I, T, EF, N, KF, K> EachKey<IF, I, T, EF, N, KF, K>
|
||||
where
|
||||
IF: Fn() -> I + 'static,
|
||||
I: IntoIterator<Item = T>,
|
||||
|
@ -199,7 +199,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<IF, I, T, EF, N, KF, K> IntoNode for Each<IF, I, T, EF, N, KF, K>
|
||||
impl<IF, I, T, EF, N, KF, K> IntoNode for EachKey<IF, I, T, EF, N, KF, K>
|
||||
where
|
||||
IF: Fn() -> I + 'static,
|
||||
I: IntoIterator<Item = T>,
|
||||
|
|
Loading…
Reference in New Issue