Skip to content

Common reactive interface #1805

@ealmloff

Description

@ealmloff

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>>>) and mapped signals

Implement Suggestion

  1. We signal something like Box<dyn Readable + Writable> and ReadOnlySignal something like Box<dyn Readable>
    a) This introduces extra overhead by boxing everything
    b) You can easily implement IntoSignal<T> for different values like T, and `
  2. We could expose the traits Readable and Writable and let components take impl Readable + Writable or impl Readable
    a) It should be lower overhead than boxing everything
    b) You could try to use specialization to implement Readable for T and 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsignalsRelated to the signals crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions