DioxusLabs / DioxusLabs/dioxus
Allow degrading Signal<T, SyncStorage> into Signal<T, UnsyncStorage>
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
## Feature Request
The ability to accept a Signal where a function or component requires a Signal
This would be very useful because it would prevent `SyncSignals` from infecting a lot of your application where they are not necessary. In my case I have a logger object I need to be able to write to from a separate thread, but in the vast majority of cases I only need to be able to write to it from the main thread, so while the signal does need to be a `SyncSignal`, in the majority of cases I don't need to use it as such.
## Implement Suggestion
I haven't used Dioxus enough or spent enough time in the codebase to be able to provide a good suggestion here, but I can imagine two approaches, either make `SyncStorage`/`UnsyncStorage` traits and have `impl for SyncStorage`, or add a `impl From for UnsyncStorage`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.