diff --git a/leptos_reactive/src/signal.rs b/leptos_reactive/src/signal.rs index 4b58ba1c34..99062597f9 100644 --- a/leptos_reactive/src/signal.rs +++ b/leptos_reactive/src/signal.rs @@ -1210,6 +1210,12 @@ where pub(crate) defined_at: &'static std::panic::Location<'static>, } +impl Default for RwSignal { + fn default() -> Self { + Self::new(Default::default()) + } +} + impl Clone for RwSignal { fn clone(&self) -> Self { *self diff --git a/leptos_reactive/src/stored_value.rs b/leptos_reactive/src/stored_value.rs index 67ed4f1bf2..0ec2e95a62 100644 --- a/leptos_reactive/src/stored_value.rs +++ b/leptos_reactive/src/stored_value.rs @@ -29,6 +29,12 @@ where ty: PhantomData, } +impl Default for StoredValue { + fn default() -> Self { + Self::new(Default::default()) + } +} + impl Clone for StoredValue { fn clone(&self) -> Self { *self