How Angular Signals and RxJS Work Together

Deborah Kurata
Deborah Kurata
28.3 هزار بار بازدید - پارسال - Common questions I hear when
Common questions I hear when talking about signals involve RxJS.
"Do signals replace RxJS?" "Is RxJS going away?" "How do signals work with RxJS?"

To answer these questions, let's take an Angular application that uses RxJS and modify it to include signals. We'll look at creating signals from Observables, and binding to those signals. And we examine techniques for reacting to a signal in an Observable pipeline.

This video assumes you have a basic knowledge of signals, the new feature in Angular v16. Signals provide more reactivity and finer control over change detection. If you aren't familiar with signals, consider watching my introductory signals video first. You can find the link below.

NOTE: The Angular team announced that they will be changing (possibly later this week):
fromObservable 👉 toSignal
fromSignal 👉 toObservable

Links
Angular Signals: What, Why, and How?: Angular Signals: What? Why? and How?

Code example: https://github.com/DeborahK/Angular-S...

Content
00:00 How do signals work with RxJS?
00:50 Sample Angular + RxJS application in action
01:23 Updating to Angular v16 next
02:20 Retrieving data with RxJS
04:00 Binding to signals
04:07 Creating a signal from an Observable
06:07 What does fromObservable() do?
06:28 Binding to signal containing the retrieve data
07:09 Running to validate our changes
07:37 Reacting to user actions with a signal (instead of a Subject)
10:08 Reacting to a signal in an Observable pipeline using fromSignal
11:25 Referencing a signal in a component
11:53 Using computed signals
12:56 Binding to signals
15:04 Running to validate our changes
15:23 Clearly defining signals for data we want tracked
15:56 Observables and Signals play well together

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
😊About Me
Hey! I'm Deborah Kurata
I'm a software developer and YouTube content creator.  I speak at conferences such as VS Live and ng-conf. I write articles for freeCodeCamp. And I'm a Pluralsight author with courses in the top 10 most popular (out of 10,000+) over the past 5 years. For my work in support of software developers, I've been recognized with the Microsoft Most Valuable Professional (MVP) award, and I'm a Google Developer Expert (GDE).

Contact me on Twitter: Twitter: DeborahKurata
Find my Pluralsight courses: https://www.pluralsight.com/profile/a...
Access my freeCodeCamp articles: https://www.freecodecamp.org/news/aut...
View my YouTube content: @deborah_kurata

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
#angular #signals #bestpractices #angularsignals #signalsinangular #demo #signaltutorial #angular16 #rxjsandsignals #signalsandrxjs
پارسال در تاریخ 1402/01/22 منتشر شده است.
28,361 بـار بازدید شده
... بیشتر