Harmeet Singh
3 min readDec 8, 2021

--

  • Is NgRx required for Angular Application Development?
Angular/NgRx Project

When one thinks about developing a web or mobile application, Angular and React are top choices for application framework. If one is a React developer, it would be easier to understand NgRx as it’s inspired by redux and follows similar pattern like store, reducer, and action. I was fortunate enough to get professional opportunities to work on both these frameworks.

If one is an Angular developer, you must wonder if you required NgRx for Angular Application.

The simple answer to this is — No it’s not required.

Let me explain.

I work in financial sector for half a decade now and you would be surprised to know that I haven’t yet used NgRx in any application that I developed. Why?Because it’s not required or mandate for angular application development.

Using NgRx in Angular development is optional, and it depends on your project requirement and architecture. Based on my experience, there aren’t specific use cases to decide whether NgRx is valuable addition to a specific project.

Let’s look at some key points that will help understand more about NgRx.

Photo by Ferenc Almasi on Unsplash

· NgRx is a set of angular library for reactive state management in angular applications, inspired by Redux.

· @ngrx/store can help you to manage the global and local state.

· @ngrx/effects allowing to write more pure components that select state and dispatch actions.

· Using Effects along with Store, decrease the responsibility of the component. It allow you to write cleaner component architecture.

· Integration with the Angular Router to listen the changes from the router’s state.

· @ngrx/entity provides a API to manipulate and adapter to managing the record collections

· @ngrx/component-store is stand-alone library that helps to manage local/component state. It’s an alternative approach to reactive push-based “Service with a Subject”.

· NgRx dev tool enhances developer experience for debugging the application

Data flow in NgRx

Check out this link to know more about NgRx

NgRx is a great tool for state management in angular applications and it helps solve certain problems. It requires good knowledge of RxJS and State Management. I would suggest to not use until one has clarity with project requirement and understand the concept of state management.

Not to know is bad; not to wish to know is worse.

– African Proverb

--

--