Angular Mistakes #6: 🛑 STOP Overusing Centralized Stores

preview_player
Показать описание

Let's discuss about the pros and cons of a centralized store architecture, and when it can be beneficial in designing Angular applications. Let's also discuss specific scenarios where it's likely being overused.

#angular

Timestamps:

0:00 Intro
01:06 Am I against centralized stores?
01:56 What is a centralized store?
05:28 Demo of a centralized store
8:53 when to use a store and why?
13:51 When NOT to use a store?
17:29 Summary and Key takeaways
18:18 What about NgRx Signal Store?

Related articles on the Angular University blog:

Free content at the Angular University:

Follow me:

Рекомендации по теме
Комментарии
Автор

Yes, 💯 with this video! Love how you have been showing simplicity with your angular videos. We have an app that uses the store for reason #3 but only things that absolutely need to be kept in sync go in the store because of the complexity.

burningtree
Автор

Very interesting, thank you for the warning. 👍

julienwickramatunga
Автор

Why should I even use redux pattern for stores when doing simple services with Subjects/BehaviorSubjects and public asObservables are much simpler? Redux adds nothing to already available Angular tools.

envo
Автор

did i hear "yak shaving" hahaha that's a new one! Good video, like most programming tools/techniques you need to know why you are using them and what benefits and drawbacks they bring. I agree, I have sections of my apps that heavily use a feature store and some features of my apps have no store because it would be overkill.

jordanking
Автор

If one of the reason for you to choose implement a in-memory clientside store is to reduce the amount of http calls to the backend when switching screens, then how would you deal with stale, lost updated UI if another user updated some content and you were not calling the api thus unaware of the changes? Possible ways to solve your problems could be:

1. Requiring user to manually f5 the page - would sounds so dumb
2. Create an websocket hub and actively listening to update from other pages - would also sounds dumb, just ditched the store and call the apis from the beginning. We shouldn't create the problem, then create the solution to fixed that problem.

phugia
Автор

How do you think of this in the mobile context (specifically an Ionic Angular app)? If you properly break your app down into many pages, are you less likely to use a centralized store? You are less likely to come across reason #3 (same data in one screen) in a mobile app.

WhatsThatItsPat
Автор

Very interesting these changes of mindset! Thanks for each video! One question, how do you think that ngrx component store fits here? the same as implementing a service with signals when needed?

MrDrogoyonk
Автор

Hey Vasco, first of all, magnificent content as always!! Thanks a lot 🙌🏻, and also a small question.

- Do you think that if you want to build a more strict architecture (A "yes" or "yes" way of implementing things, like the management of the data in the Front end) is enough justification to implement a state management tool?

For example, to implement traditional NGRX or Signals, or any other Store management tool for:

👉🏻 Make sure that new or current devs in the team who already know the "Flux architectural pattern" find themselves more familiar with the app architecture.

👉🏻 No new crazy ideas about how to handle data in every new case.

👉🏻To prevent or minimize inconsistencies about how the data is handled across the UI.

thanks a lot in advance! 😉

mikkecampos
Автор

One more reasons I would add is: how often does the data change/update? In case the data requested from the backend changes a lot, a store does not make as much sense.

DaniloGasdzik
Автор

Hey Vasco, how would you compare using NGRX vs NGXS? I have used NGXS before and it seems to be simpler alternative. However, we still have not received Signal-Store in NGXS

ali-
Автор

Hi Vasco, will miss your videos by now so much Devin AI has made us obsolete it is useless to learn new things or optimizations

mauriziostrazzullo
Автор

how does it work when you refresh the page? does the store need to be refetched?

wiliamferraciolli
Автор

Hi Vasco what is your opinion on the angular offline app first approach

deepakbawa
Автор

Sorry. I disagree with this. Using NGRX's feature creators allows organizing state into single slices that work really nicely in a vertical slice architecture. This scales well even for small apps that have a single feature. Additionally, users of internal enterprise applications also use large social media websites and have the same functionality expectations for these enterprise apps as well.

edrohler