dioxus
dioxus copied to clipboard
Common reactive interface
Specific Demand
It would be nice to provide a common way to read different reactive signal-like values. The common interface should support Signals, Fermi atoms, reactive collections (a signal that acts like Signal<Vec<Signal<T>>>>) and mapped signals
Implement Suggestion
- We signal something like
Box<dyn Readable + Writable>and ReadOnlySignal something likeBox<dyn Readable>a) This introduces extra overhead by boxing everything b) You can easily implementIntoSignal<T>for different values likeT, and ` - We could expose the traits
ReadableandWritableand let components takeimpl Readable + Writableorimpl Readablea) It should be lower overhead than boxing everything b) You could try to use specialization to implementReadableforTand specialize it on Signal, MappedSignals, and Fermi atoms c) This could introduce a lot of generics which could be an ergonomic issue depending on how well impl trait is supported within components