Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding a Reactive operator decision tree/flowchart #117

Open
banchan86 opened this issue Jan 14, 2025 · 1 comment
Open

Consider adding a Reactive operator decision tree/flowchart #117

banchan86 opened this issue Jan 14, 2025 · 1 comment
Labels
article New documentation article

Comments

@banchan86
Copy link
Contributor

banchan86 commented Jan 14, 2025

Based on an idea proposed by @jonnew on Discord, to enhance our Reactive operator documentation, we might want to consider adding a decision tree to easily choose Reactive operators. This could be added as an article on the main docs (hence why this issue is raised here) and added as a link to the respective API pages for the Reactive operators.

Possible references

@banchan86 banchan86 added the article New documentation article label Jan 14, 2025
@banchan86
Copy link
Contributor Author

banchan86 commented Feb 10, 2025

As I was playing around with this, I thought that maybe having a decision tree that leads to every single operator is a bit intimidating (has too many levels, hard to check at a glance).

  • A simple grouping might suffice, as represented in this mermaid diagram made from just the operators in the Bonsai.Reactive namespace.
  • Might be better as a table if it's just a single level.
  • Not final, I still need to check, there are definitely some operators missing (like the schedulers) and I need to verify each operator.
  • Currently too wide, but maybe we can split the operators that operate on a single observable sequence from those that take two sequences.
  • Can add links to each operators API reference page, as well as a short description on a hover tooltip.
flowchart TD
    id1(I want to...)
    id2(..do something with 1 sequence.)
    id3(..do something with more than 1 sequence.)
    id4("`**Compute a value**
    Accumulate
    Average
    Count
    ElementIndex
    IsEmpty
    Max / MaxBy
    Min / MinBy
    Sum
    `")
    id5("`**Filter or group elements**
    BufferCount
    BufferTime
    Distinct / DistinctBy 
    DistinctUntilChanged 
    DistinctUntilChangedBy 
    First / FirstOrDefault
    Last / LastOrDefault
    Skip / SkipLast
    Slice 
    Take / TakeLast
    WindowCount
    WindowTime
    `")
    id6("`**Do something with time**
    CombineTimestamp
    Delay
    DelaySubscription
    GateInterval
    SampleInterval
    Throttle
    Timeout
    Timer
    TimeInterval
    Timestamp
    `")
    id7("`**Repeat or Retry**
    Repeat
    RepeatCount
    Retry
    RetryCount
    `")
    id8("`**Transform a sequence**
    Materialize
    Dematerialize
    OrderBy
    OrderByDescending
    ThenBy
    ThenByDescending
    `")
    id9("`**Create new sequences**
    CreateObservable
    Defer
    GroupBy
    SelectMany
    `")
    id10("`**Create subscriptions**
    AsyncSubject
    BehaviourSubject
    Publish
    PublishSubject
    Replay
    ReplaySubject
    ResourceSubject
    `")
    id11("`**Filter or select elements**
    BufferTrigger
    Gate
    Sample
    SkipUntil
    SubscribeWhen
    TakeUntil
    Window
    WindowTrigger
    `")
    id12("`**Combine or merge sequences**
    Catch
    CombineLatest
    Concat
    Merge
    OnErrorResumeNext
    WithLatestFrom
    Zip
    `")
    id1 --> id2
    id1 --> id3
    id2 --> id4
    id2 --> id5
    id2 --> id6
    id2 --> id7
    id2 --> id8
    id2 --> id9
    id2 --> id10
    id3 --> id11
    id3 --> id12
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
article New documentation article
Projects
None yet
Development

No branches or pull requests

1 participant