SlideShare a Scribd company logo
ANGULAR&RXJS
FABIOBIONDI.io
SEP2018
fabiobiondi.io
TRAINING AND MENTORING
ANGULAR JAVASCRIPT REACT
OPPORTUNITÀ per DEVELOPER ITALIANI

(jobs / collaborations / training and more)
FACEBOOK GROUPS
developer italianideveloper italianideveloper italiani
RXJS-6-INTRO
interval(value)
returns an observable sequence that produces a
value after each period.
map(fn)
transform the items emitted by an Observable by
applying a function to each item
<fb-clock>
ANGULAR & RXJS
You don't need subscribe(fn)
{{myObs$ | async}}
the async Angular pipe “I” 

automatically subscribes an observer
<fb-clock>
WHERE CAN YOU USE RXJS IN ANGULAR?
ALMOST EVERYWHERE!

In components, directives, pipes, services,
XHR, router, guards, interceptors ...
ASync Pipes
{{'Milano' | temperature | async }} 

// output: 20°
Router EVENTS
FILTER Router EVENTS
Reactive FORMSTemplate-driven FORMS
RxJS operators used in forms
Create Component at Runtime
HttpClient
HttpClient & map(fn)
Leanne Graham (Sincere@april.biz)
Transform HTTP response
forkJoin(array)
Combine Multiple HTTP requests
When all observables complete, 

emit the last emitted value from each.
switchMap
Map to observable, complete previous inner observable, 

emit values.
!
NESTED XHR with switchMap(fn)
Solution
Sequential HTTP requests
exhaustMap(array)
Abort new HTTP requests until the previous one has been completed
Services
UserService: fetch data View: request and use data
perform actions or side-effects, such as logging.
tap(fn)
“Debug” and side effects with tap()
AUTHENTICATION
A value that changes over time
BehaviorSubject
Store authentication token
UI: SignInComponent
SignIn by using LoginService
LoginService
Invoke login REST Service and save token
SECURITY
*ifLogged Structural Directive
Render DOM if user is logged
Usage
AuthGuard
Disable route access if user is not logged
Usage
HTTP Interceptors
Inject token to each XHR and handle errors
NGRX (Redux)
NGRX Store
! Too many 

subscriptions
*ngIf…as
Only one 

subscription
NGRX Effects
DATA MANIPULATION
7: telly.hoeger@billy.biz
8: sherwood@rosamond.me
9: chaim_mcdermott@dana.io
10: rey.padberg@karina.bizt
FILTER ARRAY with map: easiest way
Get user ID > 6 and email lowercase
X
FILTER ARRAY WITH RXJS (1/3) 

Wrong Way
FILTER ARRAY WITH RXJS (2/3): 

flatten in single emissions
Get user ID > 6
!
Too many. I just need one!
we only need to emit one value (3/3)
Get user ID > 6 and email lowercase
scan & reduce
scan(fn)
applies an accumulator function over an observable
sequence and returns each intermediate result
reduce(fn)
apply a function to each item emitted by an
Observable, sequentially, and emit the final value
scan
!
Too many. 

I just need one!
Display the total of likes
Given an array
Display the total of likes
scan
Display the total of likes
Given an array
Display the total of likes
Yo! :)
REAL-WORLD-EXAMPLES with
scan(fn)
<Clock> Picker
Angular & RXJS: examples and use cases
<ImageGallery>
A simple carousel with timer and NEXT / PREV buttons
!
!
<ImageGallery>
Enhanced version: get Token, HTTP requests and completely “pure”
Angular & RXJS: examples and use cases
ANGULAR JAVASCRIPT REACT
OPPORTUNITÀ per DEVELOPER ITALIANI

(jobs / collaborations / training and more)
FACEBOOK GROUPS
developer italianideveloper italianideveloper italiani
fabiobiondi.io

More Related Content

PDF
Angular Observables & RxJS Introduction
Rahat Khanna a.k.a mAppMechanic
 
PDF
RxJS Operators - Real World Use Cases (FULL VERSION)
Tracy Lee
 
PDF
Introduction to RxJS
Brainhub
 
PPTX
Rxjs ppt
Christoffer Noring
 
PPTX
Top 10 RxJs Operators in Angular
Jalpesh Vadgama
 
PPTX
Introduction to RxJS
Abul Hasan
 
PDF
The New JavaScript: ES6
Rob Eisenberg
 
PDF
Angular and The Case for RxJS
Sandi Barr
 
Angular Observables & RxJS Introduction
Rahat Khanna a.k.a mAppMechanic
 
RxJS Operators - Real World Use Cases (FULL VERSION)
Tracy Lee
 
Introduction to RxJS
Brainhub
 
Top 10 RxJs Operators in Angular
Jalpesh Vadgama
 
Introduction to RxJS
Abul Hasan
 
The New JavaScript: ES6
Rob Eisenberg
 
Angular and The Case for RxJS
Sandi Barr
 

What's hot (20)

PDF
Asynchronous javascript
Eman Mohamed
 
PDF
ES6 presentation
ritika1
 
PPTX
React workshop
Imran Sayed
 
PPTX
React hooks
Ramy ElBasyouni
 
PDF
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Steve Pember
 
PPTX
Why TypeScript?
FITC
 
PPT
React js
Jai Santhosh
 
PDF
TypeScript - An Introduction
NexThoughts Technologies
 
PDF
RxJS & Angular Reactive Forms @ Codemotion 2019
Fabio Biondi
 
PPTX
Angular 2.0 forms
Eyal Vardi
 
PPTX
React Hooks
Joao Marins
 
PDF
An introduction to React.js
Emanuele DelBono
 
PPTX
Understanding react hooks
Maulik Shah
 
PDF
Expressjs
Yauheni Nikanovich
 
PDF
JavaScript Fetch API
Xcat Liu
 
PPTX
Its time to React.js
Ritesh Mehrotra
 
PDF
Microservices with Java, Spring Boot and Spring Cloud
Eberhard Wolff
 
PDF
Fundamental JavaScript [UTC, March 2014]
Aaron Gustafson
 
PDF
RxJS Evolved
trxcllnt
 
PDF
Understanding react hooks
Samundra khatri
 
Asynchronous javascript
Eman Mohamed
 
ES6 presentation
ritika1
 
React workshop
Imran Sayed
 
React hooks
Ramy ElBasyouni
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Steve Pember
 
Why TypeScript?
FITC
 
React js
Jai Santhosh
 
TypeScript - An Introduction
NexThoughts Technologies
 
RxJS & Angular Reactive Forms @ Codemotion 2019
Fabio Biondi
 
Angular 2.0 forms
Eyal Vardi
 
React Hooks
Joao Marins
 
An introduction to React.js
Emanuele DelBono
 
Understanding react hooks
Maulik Shah
 
JavaScript Fetch API
Xcat Liu
 
Its time to React.js
Ritesh Mehrotra
 
Microservices with Java, Spring Boot and Spring Cloud
Eberhard Wolff
 
Fundamental JavaScript [UTC, March 2014]
Aaron Gustafson
 
RxJS Evolved
trxcllnt
 
Understanding react hooks
Samundra khatri
 
Ad

Similar to Angular & RXJS: examples and use cases (20)

PDF
RxJS Operators - Real World Use Cases - AngularMix
Tracy Lee
 
PPTX
Luis Atencio on RxJS
Luis Atencio
 
PPTX
RxJava2 Slides
YarikS
 
PPTX
Intro to Reactive Thinking and RxJava 2
JollyRogers5
 
PPTX
RxJS In-Depth - AngularConnect 2015
Ben Lesh
 
PDF
Angular 19 - L'ère des applications complètes basées sur les signaux.pdf
moassiongbon
 
PDF
Documenting the Mined Feature Implementations from the Object-oriented Source...
Ra'Fat Al-Msie'deen
 
PDF
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
John Stevenson
 
PDF
Norikra: SQL Stream Processing In Ruby
SATOSHI TAGOMORI
 
PDF
Reactive, component 그리고 angular2
Jeado Ko
 
PDF
The magic behind your Lyft ride prices: A case study on machine learning and ...
Karthik Murugesan
 
PDF
Angular 16 – the rise of Signals
Coding Academy
 
PDF
Building scalable applications with angular js
Andrew Alpert
 
PPTX
Functional Reactive Programming (FRP): Working with RxJS
Oswald Campesato
 
PDF
Integrating Applications: the Reactive Way
Nicola Ferraro
 
PDF
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
Rouven Weßling
 
PDF
The present and future of Serverless observability
Yan Cui
 
PDF
The present and future of serverless observability (QCon London)
Yan Cui
 
PDF
The present and future of Serverless observability
Yan Cui
 
PPTX
How we sleep well at night using Hystrix at Finn.no
Henning Spjelkavik
 
RxJS Operators - Real World Use Cases - AngularMix
Tracy Lee
 
Luis Atencio on RxJS
Luis Atencio
 
RxJava2 Slides
YarikS
 
Intro to Reactive Thinking and RxJava 2
JollyRogers5
 
RxJS In-Depth - AngularConnect 2015
Ben Lesh
 
Angular 19 - L'ère des applications complètes basées sur les signaux.pdf
moassiongbon
 
Documenting the Mined Feature Implementations from the Object-oriented Source...
Ra'Fat Al-Msie'deen
 
Progscon 2017: Taming the wild fronteer - Adventures in Clojurescript
John Stevenson
 
Norikra: SQL Stream Processing In Ruby
SATOSHI TAGOMORI
 
Reactive, component 그리고 angular2
Jeado Ko
 
The magic behind your Lyft ride prices: A case study on machine learning and ...
Karthik Murugesan
 
Angular 16 – the rise of Signals
Coding Academy
 
Building scalable applications with angular js
Andrew Alpert
 
Functional Reactive Programming (FRP): Working with RxJS
Oswald Campesato
 
Integrating Applications: the Reactive Way
Nicola Ferraro
 
PHPcon Poland - Static Analysis of PHP Code – How the Heck did I write so man...
Rouven Weßling
 
The present and future of Serverless observability
Yan Cui
 
The present and future of serverless observability (QCon London)
Yan Cui
 
The present and future of Serverless observability
Yan Cui
 
How we sleep well at night using Hystrix at Finn.no
Henning Spjelkavik
 
Ad

More from Fabio Biondi (17)

PDF
Redux Toolkit - Quick Intro - 2022
Fabio Biondi
 
PDF
React - Component Based Approach
Fabio Biondi
 
PDF
Introduction to E2E in Cypress
Fabio Biondi
 
PDF
Create your React 18 / TS bundle using esbuild
Fabio Biondi
 
PDF
Create Web Components using Google Lit
Fabio Biondi
 
PDF
Redux Toolkit & RTK Query in TypeScript: tips&tricks
Fabio Biondi
 
PDF
React Typescript for beginners: Translator app with Microsoft cognitive services
Fabio Biondi
 
PDF
RXJS Best (& Bad) Practices for Angular Developers
Fabio Biondi
 
PDF
Introduction for Master Class "Amazing Reactive Forms"
Fabio Biondi
 
PDF
Data architectures in Angular & NGRX Introduction
Fabio Biondi
 
PDF
Angular Day 2018 (italy) - Keynote - The Amazing World of Angular 6
Fabio Biondi
 
PDF
Introduction to Redux (for Angular and React devs)
Fabio Biondi
 
PDF
Angular Best Practices @ Firenze 19 feb 2018
Fabio Biondi
 
PDF
React: JSX and Top Level API
Fabio Biondi
 
PDF
Intro evento: evolvere un applicazione Angular con Rxjs e Redux
Fabio Biondi
 
PDF
Single Page Applications in Angular (italiano)
Fabio Biondi
 
PDF
Angular 2 - Core Concepts
Fabio Biondi
 
Redux Toolkit - Quick Intro - 2022
Fabio Biondi
 
React - Component Based Approach
Fabio Biondi
 
Introduction to E2E in Cypress
Fabio Biondi
 
Create your React 18 / TS bundle using esbuild
Fabio Biondi
 
Create Web Components using Google Lit
Fabio Biondi
 
Redux Toolkit & RTK Query in TypeScript: tips&tricks
Fabio Biondi
 
React Typescript for beginners: Translator app with Microsoft cognitive services
Fabio Biondi
 
RXJS Best (& Bad) Practices for Angular Developers
Fabio Biondi
 
Introduction for Master Class "Amazing Reactive Forms"
Fabio Biondi
 
Data architectures in Angular & NGRX Introduction
Fabio Biondi
 
Angular Day 2018 (italy) - Keynote - The Amazing World of Angular 6
Fabio Biondi
 
Introduction to Redux (for Angular and React devs)
Fabio Biondi
 
Angular Best Practices @ Firenze 19 feb 2018
Fabio Biondi
 
React: JSX and Top Level API
Fabio Biondi
 
Intro evento: evolvere un applicazione Angular con Rxjs e Redux
Fabio Biondi
 
Single Page Applications in Angular (italiano)
Fabio Biondi
 
Angular 2 - Core Concepts
Fabio Biondi
 

Recently uploaded (20)

PDF
Exploring AI Agents in Process Industries
amoreira6
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
PPTX
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
PDF
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PDF
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
PDF
Multi-factor Authentication (MFA) requirement for Microsoft 365 Admin Center_...
Q-Advise
 
Exploring AI Agents in Process Industries
amoreira6
 
oapresentation.pptx
mehatdhavalrajubhai
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
The Role of Automation and AI in EHS Management for Data Centers.pdf
TECH EHS Solution
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
NSIQINFOTECH
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
Multi-factor Authentication (MFA) requirement for Microsoft 365 Admin Center_...
Q-Advise
 

Angular & RXJS: examples and use cases