SlideShare a Scribd company logo
1 of 17
Download to read offline
Presented By:
Alka Vats & Paras Jain
Angular State
Management-NgRx
Lack of etiquette and manners is a huge turn o๏ฌ€.
KnolX Etiquettes
Punctuality
Respect Knolx session timings, you
are requested not to join sessions
after a 5 minutes threshold post
the session start time.
Feedback
Make sure to submit a constructive
feedback for all sessions as it is
very helpful for the presenter.
Silent Mode
Keep your mobile devices in silent
mode, feel free to move out of
session in case you need to attend
an urgent call.
Avoid Disturbance
Avoid unwanted chit chat during
the session.
Our Agenda
01 Introduction to NgRx
02 What is NgRx Store?
03 NgRx and Redux
04
Using store states, actions and
reducers in NgRx
05 Demo
โ— Unlike backend applications, which use databases for state management, frontend
applications need some sort of mechanism for handling data.
โ— This data can range from server responses gotten from HTTP request, to form
input data and user routes.
โ— Itโ€™s is always a good practice to compose all your application state in a central
store for easy management and data communication. So for this the Angular State
Management comes under working.
โ— NgRx is a group of Angular libraries for reactive extensions and state management. It
makes Angular development easier by simplifying the applicationโ€™s state in objects and
enforcing unidirectional data ๏ฌ‚ow.
โ— A complete state management system should enable you to model a state.
โ— Example:
create a simple representation of what the state should look like, update its value,
monitor the state when the value changes, and retrieve the values of the state.
Introduction to NgRx
NgRx provides libraries for:
โ— Managing global and local state.
โ— Isolation of side effects to promote a cleaner component architecture.
โ— Entity collection management.
โ— Integration with the Angular Router.
โ— Developer tooling that enhances developer experience when building many
different types of applications.
NgRx packages are divided into a few main categories
โ— State
โ—‹ Store - RxJS powered global state management for Angular apps, inspired by
Redux.
โ—‹ Effects - Side effect model for @ngrx/store.
โ—‹ Router Store - Bindings to connect the Angular Router to @ngrx/store.
โ—‹ Entity - Entity State adapter for managing record collections.
โ—‹ ComponentStore - Standalone library for managing local/component state.
โ— Data
โ—‹ Data - Extension for simpli๏ฌed entity data management.
โ— View
โ—‹ Component - Extension for fully reactive Angular applications.
โ— Developer Tooling
โ—‹ Store Devtools - Instrumentation for @ngrx/store that enables visual tracking of
state and time-travel debugging.
โ—‹ Schematics - Scaffolding library for Angular applications using NgRx libraries.
*Note: In this session, weโ€™ll mostly focus on the Store library. Specifically, weโ€™ll demonstrate how
Angular components can get values from a single store.
The NgRx Store is a Redux-inspired state management system that enables you to use
observables to manage state in an Angular application.
Ngrx is a group of Angular libraries for reactive extensions.
Store is a controlled state container designed to help write performant, consistent
applications on top of Angular.
The primary advantage to using the NgRx Store is the ability to store all state in a single
tree that is accessible from any part of the application.
NgRx Store is mainly for managing global state across an entire application. In cases
where you need to manage temporary or local component state, consider using NgRx
ComponentStore.
What is NgRx Store?
NgRx and Redux
NgRx uses the Redux pattern, which is comprised of three main concepts:
i.e:- STORE , ACTIONS , REDUCERS
1. Store: A central area(store) that holds all of the application state.
2. Action: It describes all the changes in the state of the application after and
before an event is performed.
3. Reducers: It tie the store and actions together by using the de๏ฌned action to
carry out a state transition, depending on the action.
Using store states, actions, and reducers in NgRx
In this, weโ€™ll demonstrate how to use store states, actions, and reducers to simplify state
management in Angular.
Store state:
A store is basically a JavaScript object that holds data weโ€™ll be using in our application.
A simple store takes the following format:
const state = {
persons: [
{
name: "Wisdom Ekpot",
},
{
name: "John Cat",
}
]}
Actions:
Actions are methods dispatched by the component when an event is called.
Here you can de๏ฌne a type and also the payload it will be sending:
Reducers:
The createReducer method handles state transitions.
To access the state, we have to import the initial state into the reducer ๏ฌle. To
trigger an action, we use the on event, which takes the name of the action as a
parameter:
DEMO
References
โ— https://ngrx.io/docs
โ— https://blog.logrocket.com/angular-state-management-made-simple-with-ngrx/
โ— https://blog.angular-university.io/angular-2-redux-ngrx-rxjs/
Thank You !
Get in touch with us:
Lorem Studio, Lord Building
D4456, LA, USA

More Related Content

What's hot

ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentationThanh Tuong
ย 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - IntroductionSergey Romaneko
ย 
Front end architecture
Front end architectureFront end architecture
Front end architectureRemus Langu
ย 
React workshop
React workshopReact workshop
React workshopImran Sayed
ย 
react redux.pdf
react redux.pdfreact redux.pdf
react redux.pdfKnoldus Inc.
ย 
React-JS.pptx
React-JS.pptxReact-JS.pptx
React-JS.pptxAnmolPandita7
ย 
React js programming concept
React js programming conceptReact js programming concept
React js programming conceptTariqul islam
ย 
Intro to React
Intro to ReactIntro to React
Intro to ReactJustin Reock
ย 
React hooks
React hooksReact hooks
React hooksSadhna Rana
ย 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesWebStackAcademy
ย 
Workshop 21: React Router
Workshop 21: React RouterWorkshop 21: React Router
Workshop 21: React RouterVisual Engineering
ย 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.jsEmanuele DelBono
ย 
An Introduction to ReactJS
An Introduction to ReactJSAn Introduction to ReactJS
An Introduction to ReactJSAll Things Open
ย 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJSKnoldus Inc.
ย 

What's hot (20)

ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
ย 
React js
React jsReact js
React js
ย 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
ย 
reactJS
reactJSreactJS
reactJS
ย 
Front end architecture
Front end architectureFront end architecture
Front end architecture
ย 
React workshop
React workshopReact workshop
React workshop
ย 
react redux.pdf
react redux.pdfreact redux.pdf
react redux.pdf
ย 
React-JS.pptx
React-JS.pptxReact-JS.pptx
React-JS.pptx
ย 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
ย 
Intro to React
Intro to ReactIntro to React
Intro to React
ย 
React js
React jsReact js
React js
ย 
React hooks
React hooksReact hooks
React hooks
ย 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
ย 
Workshop 21: React Router
Workshop 21: React RouterWorkshop 21: React Router
Workshop 21: React Router
ย 
Introduction to Redux
Introduction to ReduxIntroduction to Redux
Introduction to Redux
ย 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
ย 
Frontend State management
Frontend State managementFrontend State management
Frontend State management
ย 
An Introduction to ReactJS
An Introduction to ReactJSAn Introduction to ReactJS
An Introduction to ReactJS
ย 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
ย 
Introduction to thymeleaf
Introduction to thymeleafIntroduction to thymeleaf
Introduction to thymeleaf
ย 

Similar to Angular state Management-NgRx

๐€๐ง ๐ˆ๐ง๐ญ๐ž๐ซ๐š๐œ๐ญ๐ข๐ฏ๐ž ๐’๐ž๐ฌ๐ฌ๐ข๐จ๐ง ๐จ๐ง ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐๐ ๐‘๐ฑ ๐›๐ฒ ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ฆ๐ž๐ง๐ญ ๐“๐ž๐š๐ฆ
๐€๐ง ๐ˆ๐ง๐ญ๐ž๐ซ๐š๐œ๐ญ๐ข๐ฏ๐ž ๐’๐ž๐ฌ๐ฌ๐ข๐จ๐ง ๐จ๐ง ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐๐ ๐‘๐ฑ ๐›๐ฒ ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ฆ๐ž๐ง๐ญ ๐“๐ž๐š๐ฆ๐€๐ง ๐ˆ๐ง๐ญ๐ž๐ซ๐š๐œ๐ญ๐ข๐ฏ๐ž ๐’๐ž๐ฌ๐ฌ๐ข๐จ๐ง ๐จ๐ง ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐๐ ๐‘๐ฑ ๐›๐ฒ ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ฆ๐ž๐ง๐ญ ๐“๐ž๐š๐ฆ
๐€๐ง ๐ˆ๐ง๐ญ๐ž๐ซ๐š๐œ๐ญ๐ข๐ฏ๐ž ๐’๐ž๐ฌ๐ฌ๐ข๐จ๐ง ๐จ๐ง ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐๐ ๐‘๐ฑ ๐›๐ฒ ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ฆ๐ž๐ง๐ญ ๐“๐ž๐š๐ฆAlbiorix Technology
ย 
Redux workshop
Redux workshopRedux workshop
Redux workshopImran Sayed
ย 
Understanding React hooks | Walkingtree Technologies
Understanding React hooks | Walkingtree TechnologiesUnderstanding React hooks | Walkingtree Technologies
Understanding React hooks | Walkingtree TechnologiesWalking Tree Technologies
ย 
Introduction to Redux.pptx
Introduction to Redux.pptxIntroduction to Redux.pptx
Introduction to Redux.pptxMohammadImran322154
ย 
an Introduction to Redux
an Introduction to Reduxan Introduction to Redux
an Introduction to ReduxAmin Ashtiani
ย 
Globant development week / React Redux Rorkshop
Globant development week / React Redux RorkshopGlobant development week / React Redux Rorkshop
Globant development week / React Redux RorkshopGlobant
ย 
Domain Logic Patterns
Domain Logic PatternsDomain Logic Patterns
Domain Logic PatternsElifTech
ย 
FRONTEND BOOTCAMP 4.pptx
FRONTEND BOOTCAMP 4.pptxFRONTEND BOOTCAMP 4.pptx
FRONTEND BOOTCAMP 4.pptxEhtesham46
ย 
Observables in Angular
Observables in AngularObservables in Angular
Observables in AngularKnoldus Inc.
ย 
downloads_introduction to redux.pptx
downloads_introduction to redux.pptxdownloads_introduction to redux.pptx
downloads_introduction to redux.pptxNavneetKumar111924
ย 
Will React Hooks replace Redux?
Will React Hooks replace Redux?Will React Hooks replace Redux?
Will React Hooks replace Redux?Trivikram Kamat
ย 
Megastore by Google
Megastore by GoogleMegastore by Google
Megastore by GoogleAnkita Kapratwar
ย 
Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"IT Event
ย 
Getting started with React and Redux
Getting started with React and ReduxGetting started with React and Redux
Getting started with React and ReduxPaddy Lock
ย 
CQRS and Event Sourcing in Action
CQRS and Event  Sourcing in ActionCQRS and Event  Sourcing in Action
CQRS and Event Sourcing in ActionKnoldus Inc.
ย 
Retrofitting a legacy SPA to use a functional architecture
Retrofitting a legacy SPA to use a functional architectureRetrofitting a legacy SPA to use a functional architecture
Retrofitting a legacy SPA to use a functional architectureManuel Rivero
ย 
Big data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on dockerBig data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on dockerFederico Palladoro
ย 
Kubernetes basics, Nodes, Pods, Containers, Deployments
Kubernetes basics, Nodes, Pods, Containers, DeploymentsKubernetes basics, Nodes, Pods, Containers, Deployments
Kubernetes basics, Nodes, Pods, Containers, DeploymentsBeroza Paul
ย 

Similar to Angular state Management-NgRx (20)

๐€๐ง ๐ˆ๐ง๐ญ๐ž๐ซ๐š๐œ๐ญ๐ข๐ฏ๐ž ๐’๐ž๐ฌ๐ฌ๐ข๐จ๐ง ๐จ๐ง ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐๐ ๐‘๐ฑ ๐›๐ฒ ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ฆ๐ž๐ง๐ญ ๐“๐ž๐š๐ฆ
๐€๐ง ๐ˆ๐ง๐ญ๐ž๐ซ๐š๐œ๐ญ๐ข๐ฏ๐ž ๐’๐ž๐ฌ๐ฌ๐ข๐จ๐ง ๐จ๐ง ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐๐ ๐‘๐ฑ ๐›๐ฒ ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ฆ๐ž๐ง๐ญ ๐“๐ž๐š๐ฆ๐€๐ง ๐ˆ๐ง๐ญ๐ž๐ซ๐š๐œ๐ญ๐ข๐ฏ๐ž ๐’๐ž๐ฌ๐ฌ๐ข๐จ๐ง ๐จ๐ง ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐๐ ๐‘๐ฑ ๐›๐ฒ ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ฆ๐ž๐ง๐ญ ๐“๐ž๐š๐ฆ
๐€๐ง ๐ˆ๐ง๐ญ๐ž๐ซ๐š๐œ๐ญ๐ข๐ฏ๐ž ๐’๐ž๐ฌ๐ฌ๐ข๐จ๐ง ๐จ๐ง ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐๐ ๐‘๐ฑ ๐›๐ฒ ๐€๐ง๐ ๐ฎ๐ฅ๐š๐ซ ๐ƒ๐ž๐ฏ๐ž๐ฅ๐จ๐ฉ๐ฆ๐ž๐ง๐ญ ๐“๐ž๐š๐ฆ
ย 
Redux in Angular 2+
Redux in Angular 2+Redux in Angular 2+
Redux in Angular 2+
ย 
Redux workshop
Redux workshopRedux workshop
Redux workshop
ย 
Understanding React hooks | Walkingtree Technologies
Understanding React hooks | Walkingtree TechnologiesUnderstanding React hooks | Walkingtree Technologies
Understanding React hooks | Walkingtree Technologies
ย 
Introduction to Redux.pptx
Introduction to Redux.pptxIntroduction to Redux.pptx
Introduction to Redux.pptx
ย 
an Introduction to Redux
an Introduction to Reduxan Introduction to Redux
an Introduction to Redux
ย 
Globant development week / React Redux Rorkshop
Globant development week / React Redux RorkshopGlobant development week / React Redux Rorkshop
Globant development week / React Redux Rorkshop
ย 
Redux
ReduxRedux
Redux
ย 
Domain Logic Patterns
Domain Logic PatternsDomain Logic Patterns
Domain Logic Patterns
ย 
FRONTEND BOOTCAMP 4.pptx
FRONTEND BOOTCAMP 4.pptxFRONTEND BOOTCAMP 4.pptx
FRONTEND BOOTCAMP 4.pptx
ย 
Observables in Angular
Observables in AngularObservables in Angular
Observables in Angular
ย 
downloads_introduction to redux.pptx
downloads_introduction to redux.pptxdownloads_introduction to redux.pptx
downloads_introduction to redux.pptx
ย 
Will React Hooks replace Redux?
Will React Hooks replace Redux?Will React Hooks replace Redux?
Will React Hooks replace Redux?
ย 
Megastore by Google
Megastore by GoogleMegastore by Google
Megastore by Google
ย 
Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"Nicholas Gustilo "Clean Android: building great mobile apps"
Nicholas Gustilo "Clean Android: building great mobile apps"
ย 
Getting started with React and Redux
Getting started with React and ReduxGetting started with React and Redux
Getting started with React and Redux
ย 
CQRS and Event Sourcing in Action
CQRS and Event  Sourcing in ActionCQRS and Event  Sourcing in Action
CQRS and Event Sourcing in Action
ย 
Retrofitting a legacy SPA to use a functional architecture
Retrofitting a legacy SPA to use a functional architectureRetrofitting a legacy SPA to use a functional architecture
Retrofitting a legacy SPA to use a functional architecture
ย 
Big data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on dockerBig data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on docker
ย 
Kubernetes basics, Nodes, Pods, Containers, Deployments
Kubernetes basics, Nodes, Pods, Containers, DeploymentsKubernetes basics, Nodes, Pods, Containers, Deployments
Kubernetes basics, Nodes, Pods, Containers, Deployments
ย 

More from Knoldus Inc.

Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxKnoldus Inc.
ย 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxKnoldus Inc.
ย 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxKnoldus Inc.
ย 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxKnoldus Inc.
ย 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationKnoldus Inc.
ย 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationKnoldus Inc.
ย 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIsKnoldus Inc.
ย 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II PresentationKnoldus Inc.
ย 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
ย 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAKnoldus Inc.
ย 
Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Knoldus Inc.
ย 
Azure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxAzure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxKnoldus Inc.
ย 
The Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinThe Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinKnoldus Inc.
ย 
Data Engineering with Databricks Presentation
Data Engineering with Databricks PresentationData Engineering with Databricks Presentation
Data Engineering with Databricks PresentationKnoldus Inc.
ย 
Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Knoldus Inc.
ย 
NoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxNoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxKnoldus Inc.
ย 
Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance TestingKnoldus Inc.
ย 
MLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxMLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxKnoldus Inc.
ย 
Introduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationIntroduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationKnoldus Inc.
ย 
CQRS with dot net services presentation.
CQRS with dot net services presentation.CQRS with dot net services presentation.
CQRS with dot net services presentation.Knoldus Inc.
ย 

More from Knoldus Inc. (20)

Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
ย 
Optimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptxOptimizing Kubernetes using GOLDILOCKS.pptx
Optimizing Kubernetes using GOLDILOCKS.pptx
ย 
Azure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptxAzure Function App Exception Handling.pptx
Azure Function App Exception Handling.pptx
ย 
CQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptxCQRS Design Pattern Presentation (Java).pptx
CQRS Design Pattern Presentation (Java).pptx
ย 
ETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake PresentationETL Observability: Azure to Snowflake Presentation
ETL Observability: Azure to Snowflake Presentation
ย 
Scripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics PresentationScripting with K6 - Beyond the Basics Presentation
Scripting with K6 - Beyond the Basics Presentation
ย 
Getting started with dotnet core Web APIs
Getting started with dotnet core Web APIsGetting started with dotnet core Web APIs
Getting started with dotnet core Web APIs
ย 
Introduction To Rust part II Presentation
Introduction To Rust part II PresentationIntroduction To Rust part II Presentation
Introduction To Rust part II Presentation
ย 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
ย 
Configuring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRAConfiguring Workflows & Validators in JIRA
Configuring Workflows & Validators in JIRA
ย 
Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)Advanced Python (with dependency injection and hydra configuration packages)
Advanced Python (with dependency injection and hydra configuration packages)
ย 
Azure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptxAzure Databricks (For Data Analytics).pptx
Azure Databricks (For Data Analytics).pptx
ย 
The Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and KotlinThe Power of Dependency Injection with Dagger 2 and Kotlin
The Power of Dependency Injection with Dagger 2 and Kotlin
ย 
Data Engineering with Databricks Presentation
Data Engineering with Databricks PresentationData Engineering with Databricks Presentation
Data Engineering with Databricks Presentation
ย 
Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)Databricks for MLOps Presentation (AI/ML)
Databricks for MLOps Presentation (AI/ML)
ย 
NoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptxNoOps - (Automate Ops) Presentation.pptx
NoOps - (Automate Ops) Presentation.pptx
ย 
Mastering Distributed Performance Testing
Mastering Distributed Performance TestingMastering Distributed Performance Testing
Mastering Distributed Performance Testing
ย 
MLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptxMLops on Vertex AI Presentation (AI/ML).pptx
MLops on Vertex AI Presentation (AI/ML).pptx
ย 
Introduction to Ansible Tower Presentation
Introduction to Ansible Tower PresentationIntroduction to Ansible Tower Presentation
Introduction to Ansible Tower Presentation
ย 
CQRS with dot net services presentation.
CQRS with dot net services presentation.CQRS with dot net services presentation.
CQRS with dot net services presentation.
ย 

Recently uploaded

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
ย 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
ย 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
ย 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
ย 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
ย 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
ย 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
ย 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
ย 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
ย 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
ย 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
ย 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
ย 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
ย 
Nellโ€™iperspazio con Rocket: il Framework Web di Rust!
Nellโ€™iperspazio con Rocket: il Framework Web di Rust!Nellโ€™iperspazio con Rocket: il Framework Web di Rust!
Nellโ€™iperspazio con Rocket: il Framework Web di Rust!Commit University
ย 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
ย 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
ย 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
ย 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
ย 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
ย 

Recently uploaded (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
ย 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
ย 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
ย 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
ย 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
ย 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
ย 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
ย 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
ย 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
ย 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
ย 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
ย 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
ย 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
ย 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
ย 
Nellโ€™iperspazio con Rocket: il Framework Web di Rust!
Nellโ€™iperspazio con Rocket: il Framework Web di Rust!Nellโ€™iperspazio con Rocket: il Framework Web di Rust!
Nellโ€™iperspazio con Rocket: il Framework Web di Rust!
ย 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
ย 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
ย 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
ย 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
ย 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
ย 

Angular state Management-NgRx

  • 1. Presented By: Alka Vats & Paras Jain Angular State Management-NgRx
  • 2. Lack of etiquette and manners is a huge turn o๏ฌ€. KnolX Etiquettes Punctuality Respect Knolx session timings, you are requested not to join sessions after a 5 minutes threshold post the session start time. Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter. Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call. Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3. Our Agenda 01 Introduction to NgRx 02 What is NgRx Store? 03 NgRx and Redux 04 Using store states, actions and reducers in NgRx 05 Demo
  • 4. โ— Unlike backend applications, which use databases for state management, frontend applications need some sort of mechanism for handling data. โ— This data can range from server responses gotten from HTTP request, to form input data and user routes. โ— Itโ€™s is always a good practice to compose all your application state in a central store for easy management and data communication. So for this the Angular State Management comes under working.
  • 5. โ— NgRx is a group of Angular libraries for reactive extensions and state management. It makes Angular development easier by simplifying the applicationโ€™s state in objects and enforcing unidirectional data ๏ฌ‚ow. โ— A complete state management system should enable you to model a state. โ— Example: create a simple representation of what the state should look like, update its value, monitor the state when the value changes, and retrieve the values of the state. Introduction to NgRx
  • 6. NgRx provides libraries for: โ— Managing global and local state. โ— Isolation of side effects to promote a cleaner component architecture. โ— Entity collection management. โ— Integration with the Angular Router. โ— Developer tooling that enhances developer experience when building many different types of applications.
  • 7. NgRx packages are divided into a few main categories โ— State โ—‹ Store - RxJS powered global state management for Angular apps, inspired by Redux. โ—‹ Effects - Side effect model for @ngrx/store. โ—‹ Router Store - Bindings to connect the Angular Router to @ngrx/store. โ—‹ Entity - Entity State adapter for managing record collections. โ—‹ ComponentStore - Standalone library for managing local/component state.
  • 8. โ— Data โ—‹ Data - Extension for simpli๏ฌed entity data management. โ— View โ—‹ Component - Extension for fully reactive Angular applications. โ— Developer Tooling โ—‹ Store Devtools - Instrumentation for @ngrx/store that enables visual tracking of state and time-travel debugging. โ—‹ Schematics - Scaffolding library for Angular applications using NgRx libraries. *Note: In this session, weโ€™ll mostly focus on the Store library. Specifically, weโ€™ll demonstrate how Angular components can get values from a single store.
  • 9. The NgRx Store is a Redux-inspired state management system that enables you to use observables to manage state in an Angular application. Ngrx is a group of Angular libraries for reactive extensions. Store is a controlled state container designed to help write performant, consistent applications on top of Angular. The primary advantage to using the NgRx Store is the ability to store all state in a single tree that is accessible from any part of the application. NgRx Store is mainly for managing global state across an entire application. In cases where you need to manage temporary or local component state, consider using NgRx ComponentStore. What is NgRx Store?
  • 10. NgRx and Redux NgRx uses the Redux pattern, which is comprised of three main concepts: i.e:- STORE , ACTIONS , REDUCERS 1. Store: A central area(store) that holds all of the application state. 2. Action: It describes all the changes in the state of the application after and before an event is performed. 3. Reducers: It tie the store and actions together by using the de๏ฌned action to carry out a state transition, depending on the action.
  • 11.
  • 12. Using store states, actions, and reducers in NgRx In this, weโ€™ll demonstrate how to use store states, actions, and reducers to simplify state management in Angular. Store state: A store is basically a JavaScript object that holds data weโ€™ll be using in our application. A simple store takes the following format: const state = { persons: [ { name: "Wisdom Ekpot", }, { name: "John Cat", } ]}
  • 13. Actions: Actions are methods dispatched by the component when an event is called. Here you can de๏ฌne a type and also the payload it will be sending:
  • 14. Reducers: The createReducer method handles state transitions. To access the state, we have to import the initial state into the reducer ๏ฌle. To trigger an action, we use the on event, which takes the name of the action as a parameter:
  • 15. DEMO
  • 17. Thank You ! Get in touch with us: Lorem Studio, Lord Building D4456, LA, USA