mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
feat: impl Copy
& Clone
for MaybeSignal
(#660)
This commit is contained in:
parent
591212a56a
commit
9d46b7bcb0
1 changed files with 11 additions and 0 deletions
|
@ -516,6 +516,17 @@ where
|
|||
Dynamic(Signal<T>),
|
||||
}
|
||||
|
||||
impl<T: Clone> Clone for MaybeSignal<T> {
|
||||
fn clone(&self) -> Self {
|
||||
match self {
|
||||
Self::Static(item) => Self::Static(item.clone()),
|
||||
Self::Dynamic(signal) => Self::Dynamic(signal.clone()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Copy> Copy for MaybeSignal<T> {}
|
||||
|
||||
impl<T: Default> Default for MaybeSignal<T> {
|
||||
fn default() -> Self {
|
||||
Self::Static(Default::default())
|
||||
|
|
Loading…
Reference in a new issue