Added SignalCloned.

This commit is contained in:
Filipe Rodrigues 2024-02-16 19:02:47 +00:00
parent 2596868670
commit 2e175babd1
Signed by: zenithsiz
SSH Key Fingerprint: SHA256:Mb5ppb3Sh7IarBO/sBTXLHbYEOz37hJAlslLQPPAPaU

View File

@ -28,6 +28,18 @@ pub trait SignalGet {
fn get(&self) -> Self::Value;
}
/// Signal cloned
#[extend::ext(name = SignalCloned)]
pub impl<S> S
where
S: SignalWith,
S::Value: Clone,
{
fn cloned(&self) -> S::Value {
self.with(|value| value.clone())
}
}
/// Signal with
pub trait SignalWith {
/// Value type