Перейти к содержимому

Angular Signal vs BehaviorSubject

Deborah Kurata

0:00 / 0:00

Angular Signal vs BehaviorSubject

16 008 просмотров · 3 г. назад
Deborah Kurata
24,3 тыс. подписчиков
16 008 просмотров · 3 г. назад
Signal vs RxJS Behavior Subject. Fight! Just kidding. 😆 In reality, there are use cases for both. In this video, we take a look at how to replace a synchronous BehaviorSubject stream with a signal. Starting in Angular v16, Angular developers can leverage the power of signals to create more reactive applications. Signals provide a new way for our code to inform our templates that data has changed, offering more granular control over how and when updates are propagated with change detection. If you aren't familiar with signals, consider watching my introductory signals video first. You can find the link below. Links Angular Signals: What, Why, and How?:    • Angular Signals: What? Why? and How?   How Angular Signals and RxJS Work Together:    • How Angular Signals and RxJS Work Together   Sample code: https://github.com/DeborahK/Angular-S... Content 00:00 Signal vs BehaviorSubject ... Fight! 00:37 Existing BehaviorSubject code 01:44 Replacing the BehaviorSubject 03:17 Updating the Input property 04:33 Creating a computed signal 05:27 Creating a signal for an array 05:40 Binding to signals 06:38 Running to validate our changes 06:57 Why replace a BehaviorSubject with a signal? ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 😊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:   / 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 #signalvsbehaviorsubject