Introduction

What is NgRx?

  1. Store           – The store is what holds the app’s state. 
  2. Action         – A unique event dispatched from components and services that describe how the state should be changed.
  3. Reducer      – All the state changes happen inside the reducer; it responds to the action, based on that action, it will create a new immutable state and return it to the store.
  4. Selector      – Selector is a function used for obtaining a part of the state from the store.
  5. Effect          – A mechanism that listens for dispatched actions in an observable stream, processes the server response, and returns new actions either immediately or asynchronously to the reducer to change the state.
  6. NgRx follows the Redux Pattern to manage the states(data).

Why NgRx and what it is trying to solve?

Prerequisites

Installation

ng add @ngrx/schematics@latest
ng add @ngrx/store –save

Conclusion

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.