feat: impl from Signal and WriteSignal for Model (#179)

This commit is contained in:
Ari Seyhun 2024-04-23 15:34:36 +08:00 committed by GitHub
parent 10a8aa402a
commit 92f2812acf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -132,6 +132,16 @@ impl<T> From<RwSignal<T>> for Model<T> {
}
}
impl<T> From<(Signal<T>, WriteSignal<T>)> for Model<T> {
fn from((read, write): (Signal<T>, WriteSignal<T>)) -> Self {
Self {
read,
write,
on_write: None,
}
}
}
impl<T> From<(ReadSignal<T>, WriteSignal<T>)> for Model<T> {
fn from((read, write): (ReadSignal<T>, WriteSignal<T>)) -> Self {
Self {