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
The signals crate docs seem to indicate that it can be used for general reactivity, not just in the context of a dioxus-launched app.
I expect it's just a matter of setting some runtime context before calling 'use_signal`, but could not find any examples showing how to do this.
Appreciate if you can add an example showing how to do this, or just respond in this thread.
The text was updated successfully, but these errors were encountered:
Signals are only usable within the dioxus runtime. I don't see anything in the readme about using dioxus-signals outside of dioxus, but if there are other docs pointing to that, they are out of date and should be removed. Generational-box is the copy runtime behind signals which can be used outside of dioxus
My flawed surmise was due to not seeing an explicit connection to the dioxus runtime.
Is there a heavy dependence on the dioxus runtime? What does 'signals' need, conceptually speaking, from its environment?
My flawed surmise was due to not seeing an explicit connection to the dioxus runtime. Is there a heavy dependence on the dioxus runtime? What does 'signals' need, conceptually speaking, from its environment?
Dioxus signals keeps track of what reactive scope it is running in for automatic dependency tracking. Each component in the dioxus runtime has a reactive scope assigned to it. Copy values like signals are allocated to the current component which is tracked in the dioxus runtime. Dioxus signals also needs to know if the current component is rendering or not and only subscribe the component to the signal if it is rendering (and not if it is running events, futures, etc)
The signals crate docs seem to indicate that it can be used for general reactivity, not just in the context of a dioxus-launched app.
I expect it's just a matter of setting some runtime context before calling 'use_signal`, but could not find any examples showing how to do this.
Appreciate if you can add an example showing how to do this, or just respond in this thread.
The text was updated successfully, but these errors were encountered: