You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am fairly new to Leptos, so appologies in advance for my ignorance!
I am building a small demo app that uses the reactive store functionality to manage some global state. Additionally I have component local state here and there that are regular signals.
I have written a component that should be able to take a signal as a property and operate on it. I would like it to be able to both work on signals derived from the store I have setup as well as regular signals I might create in other components.
My problem is that data coming out of the store seems to be of type Field<A> whereas my signals are RwSignal<A> and the two appear incompatible. Is there a way to convert between the two, or alternatively some other parent type I can use, that would allow my component to accept either?
For reference: the component in question (which currently works with my store signals but not my component local ones) looks like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi!
I am fairly new to Leptos, so appologies in advance for my ignorance!
I am building a small demo app that uses the reactive store functionality to manage some global state. Additionally I have component local state here and there that are regular signals.
I have written a component that should be able to take a signal as a property and operate on it. I would like it to be able to both work on signals derived from the store I have setup as well as regular signals I might create in other components.
My problem is that data coming out of the store seems to be of type
Field<A>
whereas my signals areRwSignal<A>
and the two appear incompatible. Is there a way to convert between the two, or alternatively some other parent type I can use, that would allow my component to accept either?For reference: the component in question (which currently works with my store signals but not my component local ones) looks like this:
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions