Replies: 1 comment 3 replies
-
Signal has a storage generic that controls if the signal is |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm reading documentation on hooks and
dioxus-signals
.I'm a bit confused on how
use_signal
upholds memory safety.It seems that the signal returns from
use_signal
can be used inspawn
(ortokio::spawn
which requiresSync
), which could run the task in a separate thread concurrently.Based on the API of
use_signal
return type, I suspect it works similar to aCell
, where elements must be cloned when access to avoid holding the lock, but it would still need a lock anyway.How does it handle that without
unsafe
code?Is it because that on every platform, dioxus is compiled to wasm and thus has only one thread for UI?
Beta Was this translation helpful? Give feedback.
All reactions