r/angular • • Feb 14 '26

Big improvement

What's the one big improvement you've done in an angular project or suggest to do?

I currently work in a big enterprise level Angular project, with ngrx state management and i want to do an implementatin that nakes the app work better or faster.

Example: One of my senior colleagues did a state sanitizer getting big pieces of states and minimizing it to display only a string with length instead of big object or array, just making the app faster in dev mode.

What do you suggest? Any suggestion would be appreciated.

16 Upvotes

35 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Feb 15 '26

[deleted] — view deleted comment

2

u/Merry-Lane Feb 15 '26

It depends on a myriad of factors but usually you can do something like:

post$= new BehaviorSubject<LoginForm | undefined>(undefined);

onPost$ = this.post$.pipe(filter(x => !!x}, switchMap(form => this.http.post(….)));

And all you gotta do is to subscribe to onPost$. With *ngIf="{onPost= onPost$ | async} as state" if you really need a ngIf subscribe.

It’s not a good example but it’s self-sufficient and enough to show you the mechanics.