mirror of
https://github.com/Zenithsiz/dynatos.git
synced 2026-02-04 10:21:23 +00:00
Added SignalCloned.
This commit is contained in:
parent
2596868670
commit
2e175babd1
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user