From a8cc450939c1d14dbb4c0f57972a068b649888af Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Mon, 1 Aug 2022 19:29:35 -0400 Subject: [PATCH] Show component is basically a less-versatile Rust bool.then() --- leptos_core/src/lib.rs | 2 -- leptos_core/src/show.rs | 31 ------------------------------- 2 files changed, 33 deletions(-) delete mode 100644 leptos_core/src/show.rs diff --git a/leptos_core/src/lib.rs b/leptos_core/src/lib.rs index bda8963c5..48001c7b1 100644 --- a/leptos_core/src/lib.rs +++ b/leptos_core/src/lib.rs @@ -1,9 +1,7 @@ mod for_component; mod map; -mod show; pub use for_component::*; -pub use show::*; pub trait Prop { type Builder; diff --git a/leptos_core/src/show.rs b/leptos_core/src/show.rs deleted file mode 100644 index f3f5513a5..000000000 --- a/leptos_core/src/show.rs +++ /dev/null @@ -1,31 +0,0 @@ -use std::marker::PhantomData; - -use crate as leptos; -use leptos_dom::{Child, Element, IntoChild}; -use leptos_macro::*; -use leptos_reactive::{ReadSignal, Scope}; - -#[derive(Props)] -pub struct ShowProps -where - W: Fn() -> bool, - C: for<'a> IntoChild<'a>, -{ - when: W, - children: C, -} - -#[allow(non_snake_case)] -pub fn Show<'a, W, C>(cx: Scope<'a>, props: ShowProps) -> impl Fn() -> Child<'a> -where - W: Fn() -> bool, - C: for<'c> IntoChild<'c> + Clone, -{ - move || { - if (props.when)() { - props.children.clone().into_child(cx) - } else { - Child::Null - } - } -}