Skip to content

Commit

Permalink
Implement IntoSplitSignal for Field.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiadliel committed Dec 14, 2024
1 parent e65969c commit 4eeb703
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion tachys/src/reactive_graph/bind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ use crate::{
view::{Position, ToTemplate},
};
use reactive_graph::{
owner::Storage,
signal::{ReadSignal, RwSignal, WriteSignal},
traits::{Get, Update},
wrappers::read::Signal,
};
#[cfg(feature = "reactive_stores")]
use reactive_stores::{KeyedSubfield, Subfield};
use reactive_stores::{ArcField, Field, KeyedSubfield, Subfield};
use send_wrapper::SendWrapper;
use wasm_bindgen::JsValue;

Expand Down Expand Up @@ -358,6 +359,21 @@ where
}
}

#[cfg(feature = "reactive_stores")]
impl<T, S> IntoSplitSignal for Field<T, S>
where
Self: Get<Value = T> + Update<Value = T> + Clone,

Check failure on line 365 in tachys/src/reactive_graph/bind.rs

View workflow job for this annotation

GitHub Actions / autofix

cannot find trait `Storage` in this scope
S: Storage<ArcField<T>>,
{
type Value = T;
type Read = Self;
type Write = Self;

fn into_split_signal(self) -> (Self::Read, Self::Write) {
(self.clone(), self.clone())
}
}

#[cfg(feature = "reactive_stores")]
impl<Inner, Prev, K, T> IntoSplitSignal for KeyedSubfield<Inner, Prev, K, T>
where
Expand Down

0 comments on commit 4eeb703

Please sign in to comment.