Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Where do we go from here? Strategies for Signals

Manfred Steyer
June 27, 2024
230

Where do we go from here? Strategies for Signals

Manfred Steyer

June 27, 2024
Tweet

More Decks by Manfred Steyer

Transcript

  1. Agenda • Austrian Desserts • Computed • Rendering Effects •

    Business Effects • RxJS Interop • Stores
  2. About me… Manfred Steyer, ANGULARarchitects.io (Remote) Angular Workshops and Consulting

    Google Developer Expert for Angular Blog, Books, Articles, and Talks about Angular Manfred Steyer
  3. Why Signals as Events are Critical? Glitch-free property: Events might

    get lost Quickly leads to Effects with Signal Writes Chains of change and cycles?
  4. But … Angular APIs are more and more Signal-based Using

    Events behind Signal change might feel unnatural <input [(ngModel)]="mySignal" (change)="…">
  5. Overlapping Req. & Race Conditions Pancakes Sacher Cake Ice Cream

    Pancakes switchMap, mergeMap, concatMap, exhaustMap
  6. Overlapping Req. & Race Conditions Pancakes Sacher Cake Ice Cream

    Pancakes switchMap, mergeMap, concatMap, exhaustMap
  7. Stores Streamline Reactive Flow Component Store "Intention" Signal sync/ async

    computed() computed() Currently: Main Use Case for Signas Business Effects, Events, RxJS and/or RxJS
  8. …long-term, we do want to move to a point where

    we’re making RxJs optional for Angular. Jeremy Elbourn Angular Tech Lead Angular Q&A Session https://www.youtube.com/live/yN1xIs0IucQ
  9. We primarily want to remove it (RxJs) from the critical

    learning journey. Minko Gechev Angular Product Lead Ng-Poland 2024 https://www.youtube.com/watch?v=QtTLZRIVaKk
  10. …there are probably many applications that will just fire a

    fetch request, get the data… you kind of give them a machinery that is more expensive to operate Pawel Koszlowski Angular Core “Future for Angular” JSParty https://changelog.com/jsparty/310
  11. It’s (RxJs) not required or strictly necessary to express async

    data flow. Minko Gechev Angular Product Lead https://twitter.com/mgechev/status/1757242040897933541
  12. Conclusion Architecture Rule #1 Synchronously derive state where possible Architecture

    Rule #2 Avoid (rendering) effects propagating state and signal writes Architecture Rule #3 Stores make your reactive flow more manageable Component Store
  13. Conclusion Hint #1 Signals play well together with RxJS Hint

    #2 Avoid Race Conditions (e.g. RxJS and/or loading flag) Hint #3 Be aware of options and consequences of Business Effects