Рет қаралды 6,562
Now that Angular signals have been out for a while, there are patterns emerging.
In this video, we'll walk through one such pattern for managing state with signals. This Redux-like pattern leverages the best of signals and RxJS.
*Links*
Code: stackblitz.com/~/edit/rxjs-signals-redux-deborahk
KZbin video: "switchMap vs concatMap vs mergeMap": kzbin.info/www/bejne/iITJaHeif72ifbM
KZbin video: "Unsubscribe with takeUntilDestroyed": kzbin.info/www/bejne/eaOXf4Wcj92UhpI
KZbin video: "Understanding Immutablity in JavaScript": kzbin.info/www/bejne/enO9doaGiJJoo7M
Josh Morony's KZbin video: "Here's what I've figured out about Angular signals" which also covers a pattern based on Redux: kzbin.info/www/bejne/r4XdaHSJoKlgbLs
Josh Morony's Article: "A New Reactive And Declarative Approach to Angular State Management": modernangular.com/articles/state-management-with-rxjs-and-signals
*Special Thanks*
🌟 To Jason Warner for an early code review.
🌟 To Freddy Montes for reviewing the code prior to publication.
🌟 To Sander Elias for a deep dive into potential enhancements to this pattern. Follow him at: mastodon.social/@sanderelias
*Content*
00:00 Redux-like pattern
00:20 Sample application
01:38 Define the state
02:23 Set the initial state
03:09 Define the selectors
04:16 Identify the actions
04:56 Define a Subject
05:55 Creating the Observable pipeline
08:59 Defining reducers
12:30 Accessing state from the component
12:48 Kicking off actions from the component
13:35 Following the pattern (again)
16:13 Modifying the component
17:13 Wrap up
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
😊About Me
Hey! I'm Deborah Kurata
I'm a software developer and KZbin content creator. I speak at conferences such as VSLive and ng-conf. I write articles for freeCodeCamp. And I'm a Pluralsight author with courses in the top 10 most popular (out of 7,000+) for over 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).
View my KZbin content: www.youtube.com/@deborah_kurata
Contact me on Twitter: DeborahKurata
Find my Pluralsight courses: www.pluralsight.com/profile/author/deborah-kurata
Access my freeCodeCamp articles: www.freecodecamp.org/news/author/deborah-kurata/
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
#angular
#angularsignals
#angularstatemanagementwithsignals
#rxjs
#rxjsandsignals
#signalsandrxjs
#angularstatemanagement
#angulartutorials
#statemanagement
#angularwithredux
#angularstatemanagementtutorial
#angularforbeginners
#statemanagementinangular
#angularredux
#angularstatemanagementbestpractices