State Management in Angular - Do I need Redux & NgRx? (2021, Advanced)

  Рет қаралды 39,382

Decoded Frontend

Decoded Frontend

Күн бұрын

Пікірлер: 111
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
🔥🔥🔥Do you want to master *Angular Material Themes* like a PRO? Check out my new Workshop where you will find a lot of advanced tips & tricks which will help you to make your themes maintainable, lean & consistent! Limited 50%-off discount is about to expire very soon: 🔗 bit.ly/angular-material-theming-workshop 🔥🔥🔥
@giorgimerabishvili8194
@giorgimerabishvili8194 3 жыл бұрын
This is definitely the best channel about Angular on KZbin! Big thumbs up and thank you very much!
@coldcircuit99
@coldcircuit99 3 жыл бұрын
I would say the most informative, not many go for going deep inside single subject but this channel does.
@emmoldovan
@emmoldovan 3 жыл бұрын
I really love this channel. I've searched for advanced Angular topics for a long time. I'm glad I found you!!
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Thanks! Welcome aboard! ;)
3 жыл бұрын
Yeah it's really hard these days to find Advanced Angular topics like they are on this channel! im abs subscribing
@giorgimerabishvili8194
@giorgimerabishvili8194 3 жыл бұрын
Just shared your channel in large (more than 50k people) Angular group on Facebook. I'm sure you'll be overwhelmed with subscriptions soon : ) And you really deserve it bro
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Wow! Thanks a lot for support!! 👍🏻
@vatsalkgor
@vatsalkgor 3 жыл бұрын
I'm glad that I'm one of the early subs of your channel, Dmitro! I'm pretty sure the channel will definitely grow to 200k subs in no time! Keep up the good work!
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Hi Vatsal, Thank you for staying with me so long time :) I hope you prediction will come true soon 😉
@gonzalocorchon6509
@gonzalocorchon6509 2 жыл бұрын
I had a teacher who taught us NGRX for Angular 6 and he said it very clearly: NGRX is not going to make you work less or simplify your tasks, it will only help you organize your code when you have many components at different levels that share their state, in any other scenario it will probably add unnecessary complexity to your project. I still think he was right after several years developing Angular projects and it's great to see that you also share that point of view. I have watched several updated tutorials to see if something had changed since I learnt it and in the end I always come to the same conclusion, for the kind of projects I do and the people working on them it is better to follow the KISS principle and not overengineer anything.
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Your teacher was right but I think he meant Redux architecture itself because NgRx is just an implementation of REDUX :)
@gonzalocorchon6509
@gonzalocorchon6509 2 жыл бұрын
@@DecodedFrontend Yep, surely he meant Redux ;)
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Before we start to code anything with NgRx I just wanted to put my thoughts about State Management and when we should rather go with Redux architecture. What do you think? In which scenarios Redux architecture beneficial and when it is better to go just with simple services. Let's discuss :)
@p.s29
@p.s29 3 жыл бұрын
Man! I love your videos!! Much Appreciated!
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Glad you like them! :)
@oleksiidashko9510
@oleksiidashko9510 2 жыл бұрын
this is the best thing I watched on the topic of NgRx in all rus💩an and English speaking KZbin
@rhea8133
@rhea8133 2 жыл бұрын
You are one reason i started liking studying and gaining knowledge outside work. Thank you so much.
@parthupadhye
@parthupadhye Жыл бұрын
Excellent content and tips. Has helped already to clarify why I am better off staying away from ngrx. Project is too small, simple and a quick MVP. Thanks.
@timtim9o5
@timtim9o5 2 жыл бұрын
The clearest explanation of the redux pattern I've heard yet, and done so nonchalantly. You're impressively concise. This was great, thank you very much!
@webmandman
@webmandman 3 жыл бұрын
Great video bro! Can’t wait for the next one ☝️
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Thank you! Coming soon! ;)
@KamelJabber1
@KamelJabber1 3 жыл бұрын
Great topic and content. Looking forward to the upcoming video in this series. Thanks!
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
More to come! Thanks ;)
@davidwang5445
@davidwang5445 2 жыл бұрын
Good presentation! Clear, objective. Thank you.
@oletrn
@oletrn Жыл бұрын
Thanks for the great video, Dmytro! This is exactly what I needed to hear now that I'm evaluating whether I should keep NgRx in an old, small project (current implementation is such an overkill in my view), or get rid of NgRx and come up with my own state management service.
@expertreviews1112
@expertreviews1112 3 жыл бұрын
I use Datorama Akita and love how it manages state…
@denisgandzii1551
@denisgandzii1551 Жыл бұрын
What do you think about NGXS? I found it very intuitive and it work fine and simple even with medium app. Would be cool to have a separate video regarding NGXS and comparation with NGRX with plus and minus.
@art_bat
@art_bat Жыл бұрын
NGXS is a much better Redux-like library than NGRX. Avoids the weakest points of Redux, that NGRX decides to repeat (the insane level of boilerplate needed to comply with the pure reducer dogma) while keeping the best parts of NGRX: the RxJs Observable Store. NGXS reducers (states), beside being pure, obliterates that dogma and can also return promises or observables: this means no need for "effects" or "sagas" and also no need for 3 actions (request/fail/success), only one action and the library handles the update The action "reducer" can execute side effects, calling async services and even dispatching another actions, and the library generates the new state when those promises or observables complete (or fail) If you also use immer in the reducers, the amount of boilerplate avoided makes to use Redux as simple again as the deceptive TODO examples without side effects used at first to conn us into it 😏
@giorgimerabishvili8194
@giorgimerabishvili8194 3 жыл бұрын
I'm looking forward to NgRx series : )
@ArunKumar-yd8qi
@ArunKumar-yd8qi 3 жыл бұрын
Thank You, Clean and Well explanation. expecting more videos on this. From India.
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
More to come! thank you :)
@shivanigaddagimath6105
@shivanigaddagimath6105 3 жыл бұрын
Hi Arun! Would you be interested in exploring job opportunities in web development? We are a web development company and looking for developers. Let me know if interested!
@MrBau25
@MrBau25 2 жыл бұрын
Great video, Dmytro! Like all of the other ones from this channel! Definitely the first place where I come to check something about Angular! :D Did you managed to make the part 2 of this video? With the application?
@otmanm4095
@otmanm4095 3 жыл бұрын
Best explanation so far !
@lindermannla
@lindermannla 2 жыл бұрын
Excellent video. Very enlightening. Congratulations!
@the-real-pawook
@the-real-pawook 2 жыл бұрын
I came to a project where NGRX was added because previous engineer came from React and didn't know how Services work. 2 years passed, still partly stuck with NGRX that doesn't solve anything in our scenario, but gives a constant mental disorder to anyone who tries to understand what is going on. My takeaway from this is that you need a solid reason otherwise you don't need it.
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Absolutelly agree!
@volodymyrusarskyy6987
@volodymyrusarskyy6987 Жыл бұрын
Hard to imagine that someone doesn't really know about services pattern nowadays 🤔 Secondly, Ngrx is not about storing data and replacing services layer (actually, you have it anyway, it is just called differently). Maybe this dev was targeting another problem? May I ask how big is the app and how many devs are supporting it? How would you implement it without Ngrx?
@vandanan9749
@vandanan9749 3 жыл бұрын
Thank you for all the videos..u r doing a wonderful job..Could you pls do a video on asynchronous programming angular,ngrx implementation,best practices using typescript,etc..I might add more;)..
@mayanksati1842
@mayanksati1842 3 жыл бұрын
Is the ngrx series out? Really liked this video and wanted to learn more.
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Hi Mayank! No, it didn't out yet. There were some reasons why it was postponed but it will out because of it was requested by many people.
@wolfisraging
@wolfisraging 3 жыл бұрын
Awesome video as always :)
@L0kiTheGhost
@L0kiTheGhost 3 жыл бұрын
Hi, I just binge watched all your Angular videos, very interesting stuff. Are you planning on doing other custom Material components like a dropdown with a search input inside when you toggle it? I've seen this on gitlab and github
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Hi, I actually have similar videos. Check out this one: kzbin.info/www/bejne/epzLYa2mqMhjkNk then this one kzbin.info/www/bejne/epzLYa2mqMhjkNk and these 2 kzbin.info/www/bejne/boXLh6KcZbetbJY , kzbin.info/www/bejne/d4vWqGWkh92eeM0
@samuelpariona7870
@samuelpariona7870 3 жыл бұрын
what are your thoughts on NGXS?, great video man
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Thank you! Tbh I didn’t try it yet, so I can say nothing so far ☹️ but once I have some experience I will make some videos
@chinthanagunasekara7469
@chinthanagunasekara7469 3 жыл бұрын
its really good one. still I'm thinking redux and ngrx makes application more complex. but still i'm using services for state management
@RajibGangulydesignerg
@RajibGangulydesignerg 3 жыл бұрын
just to say, i love your video. just keep it up
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Thanks :)
@shivanigaddagimath6105
@shivanigaddagimath6105 3 жыл бұрын
Hi Rajib! Would you be interested in exploring job opportunities in web development? We are a web development company and looking for developers. Let me know if interested!
@ayoubaitlachgar
@ayoubaitlachgar 2 жыл бұрын
Thank You for handling the subject differently. A Good Software engineer should always be able to define the WHY's of using each technology. Not a follower to any new trend or fancy tech
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Absolutely, Ayoub!
@haroldpepete
@haroldpepete 2 жыл бұрын
great explanation about this controversial topic, some developers take redux because is the new fashion but the don't see the real benefit to integrate this tool to the project, sometimes is not required, by the way you must make a video teaching what is the correct pronunciation of your name
@lockness2304
@lockness2304 3 жыл бұрын
Could you please make use of 'Indefinite articles'? It would greatly improve your comprehensibility.
@syimykamatov8955
@syimykamatov8955 Жыл бұрын
Thanks for sharing your opinion!
@nikhilgoyal007
@nikhilgoyal007 10 ай бұрын
This is gold! thank you!!!
@tomaszbj
@tomaszbj 2 жыл бұрын
cool channel and easy clear informations, thx!
@sroDrakso
@sroDrakso 2 жыл бұрын
Awesome chanel. Keep going!
@vivekraj1427
@vivekraj1427 3 жыл бұрын
Really very informative but where are the following videos on redux.
@GuillaumeMaka
@GuillaumeMaka 2 жыл бұрын
Thanks for the video! Any thoughts about akita or ngneat/elf ?
@mykolastrashok9986
@mykolastrashok9986 3 жыл бұрын
Thank you for this video.
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
You’re welcome 😊
@patilrohan
@patilrohan 2 жыл бұрын
Can you please make a video on MobX state management using Angular
@its_vincesanity
@its_vincesanity 2 жыл бұрын
I don't really understand what problem Redux would solve. Because my project is big, it's not really convincing. Sharing data through independent components is also easy doable, with a Subject. Can someone put it clear, why I should implement such a heavy thing in my application?
@envo2199
@envo2199 7 ай бұрын
if you can use subjects and access them as observables, literally no advantage of using this imho.
@DjSilent
@DjSilent 3 жыл бұрын
Thank you for your thoughts. Do you work with cypress?
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
I have a little experience. Positive experience I have to say :)
@DjSilent
@DjSilent 3 жыл бұрын
@@DecodedFrontend yeah I am having an enjoyable experience however angular cypress cucumber training videos are very hard to come by. I would like one to cover routes that have resolvers and guards Any how keep up the good work
@mib8254
@mib8254 3 жыл бұрын
Im using akita to handle state management. Its more angularish then the famous ngrx.
@alaakhalila9022
@alaakhalila9022 2 жыл бұрын
Hello decoded, I'm confused why do we use NGRX if we can make a global service and inject it in 'root' ??
@ihor-pidhornyi
@ihor-pidhornyi 2 жыл бұрын
So if I'm starting a new project in company, I shouldn't be considering Redux, but if I'd see that the app grows and I have started write services in my own conventions, I should migrate to NGRX. In this case I want to ask a question, do I need to rewrite existing services into a Redux, or just start with only new ones. Of course this question depend on how much time I have, but overall, would it be better to rewrite most services into the Redux?
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
it is very hard to say without any knowledge about the project, but in general, theoretically, you could write new features using NgRx and then incrementally migrate the old ones. Also, to simplify the future migration, I would say that you could build some abstraction around services that are responsible for state management. For inspiration, You can also have a look at Facade Pattern that could help to make your components "independent" from the concrete implementation of your state management, so when you migrate to NgRx you wouldn't need to touch at least your components. Yes, it has some prose and cons but... please show me what doesn't have them :)
@ihor-pidhornyi
@ihor-pidhornyi 2 жыл бұрын
@@DecodedFrontend I understand that's hard to give more detailed answer, but thx anyway. Also wanted to ask you about services, in video you said it's ok to use them. By that you meant stateless services with just server calls or stateful services with subjects that can hold some data. Previously had discussion in which one person said it's not okay to use subjects for holding state, because it's not rxjs' task to handle state. At some point I'd agree with him, but I don't think there is such a radical answer. So my last question, if you don't mind, is about services, and what you meant by them, from above told.
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
@@ihor-pidhornyi I meant mostly stateful services that hold state in BehaviorSubject (but can be applicable for any statefull service). I don't know the details of the discussion and what your collegue meant exactly but IMO it is ok when you store the state in BehaviorSubject. There is co-called "Push-Based" architecture that is basically build on top of this idea. Also, if you have a look at the source code of NgRx, you will see that the State there is represented as a sub-class of BehaviorSubject... so... :) github.com/ngrx/platform/blob/master/modules/store/src/state.ts
@ihor-pidhornyi
@ihor-pidhornyi 2 жыл бұрын
@@DecodedFrontend Heh, really. I think mostly the way you do about Behaviour Subjects and I think he is just kind of person who has strict views on something. Btw, he uses mobx with angular and says it's very comfortable, so I'm trying now to research a lot of resources and decide which way I should go. Thanks a lot for your answers 😊❤️
@MarcellodiSimone
@MarcellodiSimone 2 жыл бұрын
Did you notice that the light spot on your back wall shows 45 then at about 2:50 it shows 43 and at 4:45 its 47
@andylib
@andylib 3 жыл бұрын
What do I do when I know the project will be huge but is using GraphQL? Is the risk of having two sources of truth still given?
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Hi Andy! Until you’re not combining it with Apollo client you shouldn’t encounter the issue with 2 sources of truth.
@andylib
@andylib 3 жыл бұрын
@@DecodedFrontend that’s interesting 🤔 unfortunately I haven’t tried apollo yet so that I could understand why exactly it would be a problem - but I guess I’ll find out soon enough 😁
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
@@andylib the problem is that Apollo Client also implements its state management and it has its own store (cache), basically like a Store in NgRx which automatically introduces „2 sources of truth“ issue. Unlike NgRx where you update store using Actions and reducers in Apollo Client you interact with a Apollo store via GraphQL queries/mutations. You just have to check both and pick the one which better fits to your team and project requirements and go with it
@andylib
@andylib 3 жыл бұрын
@@DecodedFrontend Thank you for your insight 😊🙏🏻
@umermalik2907
@umermalik2907 Жыл бұрын
Which is better ngrx vs ngxs ?
@ahmedsokar2909
@ahmedsokar2909 3 жыл бұрын
Great
@Шакал-к6н
@Шакал-к6н 2 жыл бұрын
Прикольна чо, спс за информацию
@daviddonadze221
@daviddonadze221 3 жыл бұрын
I love NgRx
@Stevexupen
@Stevexupen Жыл бұрын
MVP means Minimum Viable Product, not minimum valuable project
@emberarc
@emberarc 2 жыл бұрын
OK, but what is 47?
@Koldraon
@Koldraon 2 жыл бұрын
Maybe Dmytro is a fan of Hitman Game Series? ;-)
@mohamedelhawy4124
@mohamedelhawy4124 2 жыл бұрын
💌
@rezyadlf
@rezyadlf 3 жыл бұрын
I guess for prototyping and small projects angular not fits at all.
@ilnurryazhapov
@ilnurryazhapov 2 жыл бұрын
why is the number 45 on the wall? 😂
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Haha indeed lol! now I can't stop to see 45 as well 😂
@minigeek
@minigeek 3 жыл бұрын
Hehe.. me in the video👹
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
Hope you don’t mind? 😉
@minigeek
@minigeek 3 жыл бұрын
@@DecodedFrontend haha why would I😹
@coldcircuit99
@coldcircuit99 3 жыл бұрын
simple answer, nope not at all.
@DecodedFrontend
@DecodedFrontend 3 жыл бұрын
:D I actually tend to agree with you but I wouldn't be so radical. There are apps where it make sense but very often it is being misused :)
@coldcircuit99
@coldcircuit99 3 жыл бұрын
@@DecodedFrontend i generally am against using unnecessary 3rd party libraries within angular framework and with perfectly fine data management that services provide redux really in 99% of cases is unnecessary solution to keep global state.
@GLawSomnia
@GLawSomnia 3 жыл бұрын
I actually agree with you. Services with Subjects is most of the time enough and actually cleaner and more straightforward to implement. We implemented some part of our project (started refactoring it to use ngrx, but time didn't allow us to finish). But its a real pain to come back to it after some time of not using it.
RxJs Schedulers - Why do we need them? (Advanced, 2021)
22:26
Decoded Frontend
Рет қаралды 17 М.
Angular Dependency Injection in Depth - Resolution modifiers (2021)
14:39
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 45 МЛН
规则,在门里生存,出来~死亡
00:33
落魄的王子
Рет қаралды 31 МЛН
когда не обедаешь в школе // EVA mash
00:51
EVA mash
Рет қаралды 4,4 МЛН
Angular Redux - NgRx Angular, NgRx store, NgRx Effects, NgRx selectors
30:31
Monsterlessons Academy
Рет қаралды 65 М.
Angular + NGRX за час
1:02:31
Максим Гром
Рет қаралды 36 М.
RxJS Scan Operator - How to Manage the State
16:33
Decoded Frontend
Рет қаралды 11 М.
Angular Json File - My Top 8 Settings (2022)
29:30
Decoded Frontend
Рет қаралды 27 М.
Angular Mistakes #6: 🛑 STOP Overusing Centralized Stores
20:20
Angular University
Рет қаралды 6 М.
I bet you can understand NgRx after watching this video
22:48
Joshua Morony
Рет қаралды 184 М.
Error Handling in Angular - Complete Guide (2022)
41:27
Decoded Frontend
Рет қаралды 69 М.
RxJs switchMap vs mergeMap - Intro to Flattening Operators (2021)
25:44
Decoded Frontend
Рет қаралды 29 М.
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 45 МЛН