Angular Signals: Where Do they Go?

Ғылым және технология

Where do Angular Signals go when using RxJS? Consider exposing service state and managing component state with signals!
You may find a common dividing line in the middle of our custom data service. We often use signals to the left of this line, and RxJS to the right. This isn't a hard and fast rule, but it's becoming a common practice.
RxJS and observables are our goto for asynchronous operations, such as HTTP requests. So our data service uses observables to issue HTTP requests and return the responses.
We leverage the large set of observable operators. We modify, filter, merge, and process data as needed for our application.
And we use a Subject for reacting to user actions, especially when we need every notification.
We then create a signal from that observable. Signals provide powerful yet painless techniques for managing state in the data service. The components access those signals. And the templates read the signals from the component.
This approach leverages the best features of signals: Reactivity with computed signals, and improved change detection in the template. The template tracks signals and re-renders when the signal changes, minimizing the amount of unnecessary re-rendering and improving performance.
This content is from my new Pluralsight course: "RxJS and Angular Signals Fundamentals"
Links
Pluralsight course: www.pluralsight.com/library/c...
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
😊About Me
Hey! I'm Deborah Kurata
I'm a software developer and KZread 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: www.pluralsight.com/profile/a...
Access my freeCodeCamp articles: www.freecodecamp.org/news/aut...
View my KZread content: / @deborah_kurata
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
#angular #angulartutorial #bestpractices #signals #angularsignals #rxjsangular #angularrxjs #rxjsobservable #observable

Пікірлер: 25

  • @ArchitecturalAesthetics2046
    @ArchitecturalAesthetics20465 ай бұрын

    signals for components and templates and observables for http requests is a great way of defining the use cases for both. not having to use async pipe and subscribe is a godsend.

  • @deborah_kurata

    @deborah_kurata

    5 ай бұрын

    Yep! Agreed. Looking forward to more exciting signal features!

  • @MuzaffarKosimov
    @MuzaffarKosimov7 ай бұрын

    Thanks for your videos about signals, I watched all Signal playlist and I didn't hear about Signal effects is in practice, I hope I'll be first to see about effects from your channel 😊 if you are planning to publish video about that Thanks again. 😊

  • @deborah_kurata

    @deborah_kurata

    7 ай бұрын

    There are some issues with effects, specifically about how they are scheduled, that the Angular team is still working on. So the effects feature is still in "developer preview" while most of the other signal features are now in a "stable" state.

  • @joeyvico
    @joeyvico7 ай бұрын

    Amazing Deborah. Subscribed!

  • @deborah_kurata

    @deborah_kurata

    7 ай бұрын

    Thank you! 😊

  • @acodersjourney
    @acodersjourney7 ай бұрын

    Hey! 👋 I'm a dedicated follower of your content and absolutely love the unique perspective you bring to the platform. I'm passionate about what you do and believe I could contribute significantly as your channel manager. With my computer skills, I'm confident in my ability to help elevate your channel even further. Let's chat about the exciting possibilities - I'm not just a fan; I'm ready to be an integral part of your success story!

  • @deborah_kurata

    @deborah_kurata

    6 ай бұрын

    Thank you so much for your offer. I'm not in the market for a channel manager right now.

  • @sourishdutta9600
    @sourishdutta96007 ай бұрын

    Hello! Mam, can you please discuss how the signal will improve the change detection. How it actually notify Angular to run the reconciliation process. Thank You so much :)

  • @deborah_kurata

    @deborah_kurata

    7 ай бұрын

    With Angular v17, the improved change detection is not yet fully there. The Angular team is still working on it. I'm planning to do a video as soon as the new functionality is in place. What currently works is the OnPush change detection strategy. When a signal is read in a template, that signals is "registered" to be tracked. When that signal is changed, Angular marks the component as "dirty" and the value is updated the next time change detection runs. See the Angular documentation for more information: angular.io/guide/signals#reading-signals-in-onpush-components

  • @metric152
    @metric1527 ай бұрын

    i was trying to figure out a good dividing line for where to use what and that makes a lot of sense. i like rxjs (now that i understand it) and would still like to use it. processing data seems like the best application and using signals to update the ui is much better

  • @deborah_kurata

    @deborah_kurata

    7 ай бұрын

    Sounds like a great approach!

  • @yasmelfl5146
    @yasmelfl51463 ай бұрын

    Hello thank you for this wonderful video I have a question regarding signals, if the goal of signals is to use signals inside html template and avoid using normal variables, what about when we have a signal of a complex object with a lot of properties to bind with the html template, using only this signal object to access properties inside the html is like not using signals anymore, one solution is to compute every property into a signal which will generate a lot of additional work and memory allocations I hope Angular team comes up with some sort of solution.

  • @user-bt1pu3dt7j
    @user-bt1pu3dt7j7 ай бұрын

    Thank you very much for all your clear explanations, I enjoy your videos very much... Can you please tell if the rxjs interop package is already stable in angular 17? Is it still not the time to implement Signals with rxjs interop in my projects?

  • @deborah_kurata

    @deborah_kurata

    7 ай бұрын

    Glad the videos have been useful! The RxJS interop package is still in developer preview. (As per this: angular.io/guide/rxjs-interop) I've been using them in my services, so they are fairly encapsulated. It wouldn't be too difficult in my code to modify them if the API changed. You *could* using RxJS Interop in your project now, knowing the API could change. Or you could wait for them to be marked as "stable". You'd need to weight your benefits vs risks.

  • @rsalit
    @rsalit6 ай бұрын

    Can you describe the differences and use cases for using Signals vs Ngrx? I learned Ngrx from your course and wondering how to know which tool should be used.

  • @deborah_kurata

    @deborah_kurata

    6 ай бұрын

    The latest version of NgRx uses signals: dev.to/ngrx/announcing-ngrx-v17-introducing-ngrx-signals-operators-performance-improvements-workshops-and-more-55e4 Right now, signals provide several key functions: - The ability to have computed properties that automatically recalculate when their dependent signals change. - Better change detection (using onPush now, but will be built in soon). - Create simple state management features. NgRx greatly expands on this providing more full featured state management. Does that answer your question?

  • @rishukumar7586
    @rishukumar75867 ай бұрын

    I have access to all of your courses with my current organisation subscription but why this course alone asking for upgrade in pluralsight ?

  • @deborah_kurata

    @deborah_kurata

    7 ай бұрын

    I don't know. You could try contacting pluralsight support at support@pluralsight.com. I'll ask on my side as well to see if it is a more general problem.

  • @deborah_kurata

    @deborah_kurata

    7 ай бұрын

    The person at Pluralsight I just spoke to suggested this: "tell him to log in and log out, and try again"

  • @rishukumar7586

    @rishukumar7586

    7 ай бұрын

    @@deborah_kurata thanks it worked

  • @erics.a.3875

    @erics.a.3875

    6 ай бұрын

    @@deborah_kurata

  • @Storiada
    @Storiada3 ай бұрын

    is this an AI voice? :)

  • @deborah_kurata

    @deborah_kurata

    3 ай бұрын

    😥 No, it's my midwestern US tone. You can change the speed of the player in KZread if that helps.

  • @Storiada

    @Storiada

    3 ай бұрын

    @@deborah_kurata ok, my bad than… sorry for that

Келесі