RxJS - The Reactive Extensions for JavaScript
Viliam Elischer @vireliam
What is RxJS?
Reactive Extensions (Rx) is a library for composing
asynchronous and event-based programs using observable
sequences and LINQ-style query operators.
Reactive eXtensions offer a language neutral approach and
polyglot implementation as well.
JavaScript Java Scala Clojure Groovy C++
C# Ruby Python JRuby Kotlin Swift
Crafted by
The Cloud Programmability Group at Microsoft
RxJS - The Reactive Extensions for JavaScript
Why?
A Temporal dimension
Asynchronous programming tend to end up in callback hell
which is frustrating
Promises FTW
but there are uses-cases when you need to:
cancel or do bulk operations or get
multiple values or do complex composition
RxJS is ideal for
processing sequences that can contain any
amount of values in any amount of time.
Core concepts
Design patterns
Iterator ­ hasNext(), next()
Observer ­ Subject, notify(), update()
Event | Stream | Sequence | Source
Observable | Observer | Subscription | Disposable
An Event stream is a sequence of events.
A Sequence is an observable Source.
A Source can be observed and act as entry point.
An Observer registers its interest on an Observable through
a Subscription.
The Observable pushes data to the Observer.
The Subscription returns a Disposable so the Observer can
stop receive notifications before the sequence ends.
General theory of reactivity
Single
value
Multiple values
Pull / Sync /
Interactive
Object Iterables (Array / Set /
Map)
Push / Async /
Reactive
Promise Observable
github.com/kriskowal/gtor
Applied duality
Array | Iterator - consumer synchronously pulls values
from producer
Observable | Observer - producer asynchronously pushes
values to the consumer
Enumerable collection interfaces IEnumerable<T>and
IEnumerator<T>are dual to interfaces of observable
collections IObservable<T>and IOberserver<T>
Subject/Observer is Dual to Iterator by Erik Meijer
Stream endpoints
Entry points / Sources:
user input (click, mouseMove, keyUp), network (XHR, WS),
setters, event listening
Exit points / Subscribers:
appState mutation, persistence, render, event emitting
Operators ~131
RP != FRP
Functional reactive programming
How to build reactive systems using
mathematical functions for describing the
universe and it's components, keeping
functional as the higher matter?
The semantic model of FRP in side-effect
free languages is typically in terms of
continuous functions, and typically over
time
FRP has well known and defined interfaces
Values that vary over continuous (clock like) time
(behaviors, signals)
Events which have occurrences at discrete points in time.
Originates from FRAN (Haskell's functional-reactive
animation framework)
Reactive Programming
aims onto handling of async sequences from multiple
sources over time
time isn't continuous but discrete, the universe is
mutable (setters) and execution environment can be
single-threaded (browser, node)
Functional in RP is a quality of the implementation detail
(HOF, map, filter, reduce)
RX separates notion of time from reactivity and focuses
more on concurrency
Reactive Programming
compositional event processing
Examples
Observable creation
from variables, arrays, promises, generators, events
Cancel async
Chaining
Map and FlatMap
TakeUntil
Scan vs Reduce
- withoutTransducing intermediary arrays
+ +Subject State observable Global subject
Benefits of using RxJS?
Abstraction layer
Composable Observables
Clean Asynchronous Code
Error handling
Event processing
Performance
Client/Server
Less mutation of global state
Set operations (Sync / Async)
Improved WebSocket Support
Interoperability
Advanced topics
Schedulers as Concurrency providers
Hot and Cold Observables
Backpressure
async function*-
Reactive Webworkers
Transducers
async generators (ES7)
Alternatives
Bacon.js
Kefir.js
Resources
github.com/Reactive-Extensions
xgrommx.github.io/rx-book
github.com/jhusain/learnrx
Gitter - Reactive-Extensions/RxJS
github.com/staltz/rxmarbles
People
Matthew Podwysocki - @mattpodwysocki
Jafar Husain - @jhusain
Ben Lesh - @BenLesh
André Staltz - @andrestaltz
Q & A
Tank you!

More Related Content

PPTX
Reactive Extensions for JavaScript
PPTX
Reactive Programming and RxJS
PDF
My Gentle Introduction to RxJS
PDF
Reactive programming using rx java & akka actors - pdx-scala - june 2014
PPTX
Intro to Functional Programming with RxJava
PDF
RxJava on Android
PPTX
Reactive
PPTX
An Introduction to RxJava
Reactive Extensions for JavaScript
Reactive Programming and RxJS
My Gentle Introduction to RxJS
Reactive programming using rx java & akka actors - pdx-scala - june 2014
Intro to Functional Programming with RxJava
RxJava on Android
Reactive
An Introduction to RxJava

What's hot (20)

PPTX
Apache Flink @ NYC Flink Meetup
PDF
Functional Reactive Programming / Compositional Event Systems
PDF
RxJava in practice
PPTX
Introduction to RxJava on Android
PPTX
Jug Marche: Meeting June 2014. Java 8 hands on
PDF
Streaming data to s3 using akka streams
PDF
Streaming Data Flow with Apache Flink @ Paris Flink Meetup 2015
PPTX
RxJS and Reactive Programming - Modern Web UI - May 2015
PDF
Streaming Dataflow with Apache Flink
ODP
Modern Java Features
PPT
jimmy hacking (at) Microsoft
PDF
RxJava@Android
PDF
Identifying memory leaks in Android applications
PDF
RxJava applied [JavaDay Kyiv 2016]
PDF
From Java to Kotlin - The first month in practice v2
PDF
MongoDB World 2016: Implementing Async Networking in MongoDB 3.2
PPTX
Real world functional reactive programming
PPTX
Simseer.com - Malware Similarity and Clustering Made Easy
PDF
Flink Forward Berlin 2017: Matt Zimmer - Custom, Complex Windows at Scale Usi...
PDF
0xdata H2O Podcast
Apache Flink @ NYC Flink Meetup
Functional Reactive Programming / Compositional Event Systems
RxJava in practice
Introduction to RxJava on Android
Jug Marche: Meeting June 2014. Java 8 hands on
Streaming data to s3 using akka streams
Streaming Data Flow with Apache Flink @ Paris Flink Meetup 2015
RxJS and Reactive Programming - Modern Web UI - May 2015
Streaming Dataflow with Apache Flink
Modern Java Features
jimmy hacking (at) Microsoft
RxJava@Android
Identifying memory leaks in Android applications
RxJava applied [JavaDay Kyiv 2016]
From Java to Kotlin - The first month in practice v2
MongoDB World 2016: Implementing Async Networking in MongoDB 3.2
Real world functional reactive programming
Simseer.com - Malware Similarity and Clustering Made Easy
Flink Forward Berlin 2017: Matt Zimmer - Custom, Complex Windows at Scale Usi...
0xdata H2O Podcast
Ad

Viewers also liked (20)

PPTX
PPTX
Functional Reactive Programming with RxJS
PPTX
Angular2 + rxjs
PDF
RxJS - The Reactive extensions for JavaScript
PDF
Reactive Programming with JavaScript
PDF
Angular 2 observables
PDF
RxJS Evolved
PPTX
Angular2 rxjs
PDF
Reactive Javascript - FrOSCon - 2016
PPSX
Reactive Programming In JavaScript
PDF
WebCamp:Front-end Developers Day. Роман Якобчук "FRP + React, building async ...
PDF
Real-world applications of the Reactive Extensions
PDF
Ember.js - Jak zatopit a neshořet!
PPTX
Vývojařská Plzeň - React
PPTX
Discovering RxJS - MilanoJS Meeting in May 2016
PPTX
Observables in angular2
PDF
Keep your side-effects 
in the right place with 
redux observable
PDF
RxJS101 - What you need to know to get started with RxJS tomorrow
PDF
FRP with Ractive and RxJS
PDF
ReactiveX-SEA
Functional Reactive Programming with RxJS
Angular2 + rxjs
RxJS - The Reactive extensions for JavaScript
Reactive Programming with JavaScript
Angular 2 observables
RxJS Evolved
Angular2 rxjs
Reactive Javascript - FrOSCon - 2016
Reactive Programming In JavaScript
WebCamp:Front-end Developers Day. Роман Якобчук "FRP + React, building async ...
Real-world applications of the Reactive Extensions
Ember.js - Jak zatopit a neshořet!
Vývojařská Plzeň - React
Discovering RxJS - MilanoJS Meeting in May 2016
Observables in angular2
Keep your side-effects 
in the right place with 
redux observable
RxJS101 - What you need to know to get started with RxJS tomorrow
FRP with Ractive and RxJS
ReactiveX-SEA
Ad

Similar to RxJS - The Reactive Extensions for JavaScript (20)

PPTX
PDF
Reactive in Android and Beyond Rx
PDF
(Functional) reactive programming (@pavlobaron)
PDF
Spring 5 Webflux - Advances in Java 2018
PDF
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
PPTX
RDF Stream Processing: Let's React
PPTX
Reactive Programming with RxJS
PDF
Microservices with Spring 5 Webflux - jProfessionals
PDF
Beyond Fault Tolerance with Actor Programming
PDF
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
PDF
PHP Reactive Programming at Medan Tech Day 2018
PDF
NGRX Apps in Depth
PDF
IPT High Performance Reactive Java BGOUG 2016
PPT
FraSCAti Adaptive and Reflective Middleware of Middleware
PDF
Reactive programming and RxJS
PPTX
RxJS vs RxJava: Intro
PDF
A Quick Intro to ReactiveX
PDF
IPT Reactive Java IoT Demo - BGOUG 2018
PPTX
Орхан Гасимов: "Reactive Applications in Java with Akka"
PPTX
Reactive extensions
Reactive in Android and Beyond Rx
(Functional) reactive programming (@pavlobaron)
Spring 5 Webflux - Advances in Java 2018
Reactive Java Robotics and IoT - IPT Presentation @ Voxxed Days 2016
RDF Stream Processing: Let's React
Reactive Programming with RxJS
Microservices with Spring 5 Webflux - jProfessionals
Beyond Fault Tolerance with Actor Programming
Beyond fault tolerance with actor programming - Fabio Tiriticco - Codemotion ...
PHP Reactive Programming at Medan Tech Day 2018
NGRX Apps in Depth
IPT High Performance Reactive Java BGOUG 2016
FraSCAti Adaptive and Reflective Middleware of Middleware
Reactive programming and RxJS
RxJS vs RxJava: Intro
A Quick Intro to ReactiveX
IPT Reactive Java IoT Demo - BGOUG 2018
Орхан Гасимов: "Reactive Applications in Java with Akka"
Reactive extensions

Recently uploaded (20)

PDF
M01-Manage Safety and Environmental Protection 1.pdf
PPTX
Ingredients of concrete technology .pptx
PPTX
sinteringn kjfnvkjdfvkdfnoeneornvoirjoinsonosjf).pptx
PDF
Water Supply and Sanitary Engineering Textbook
PPT
linux chapter 1 learning operating system
PPTX
CC PPTS unit-I PPT Notes of Cloud Computing
PDF
IMDb_Product_Teardown_product_management
PDF
ForSee by Languify Teardown final product management
PDF
Application of smart robotics in the supply chain
PDF
Snapchat product teardown product management
PPTX
highway-150803160405-lva1-app6891 (1).pptx
PDF
02. INDUSTRIAL REVOLUTION & Cultural, Technical and territorial transformatio...
PDF
Computer Networks and Internet Protocol Week-1
PPTX
Soumya Das post quantum crypot algorithm
PDF
Project_Mgmt_Institute_- Marc Marc Marc.pdf
PPTX
Retail.pptx internet of things mtech 2 nd sem
PDF
Operating systems-POS-U1.2.pdf cse gghhu
PDF
IoT-Based Hybrid Renewable Energy System.pdf
PPTX
Downstream processing_in Module1_25.pptx
PDF
ITEC 1010 - Information and Organizations Database System and Big data
M01-Manage Safety and Environmental Protection 1.pdf
Ingredients of concrete technology .pptx
sinteringn kjfnvkjdfvkdfnoeneornvoirjoinsonosjf).pptx
Water Supply and Sanitary Engineering Textbook
linux chapter 1 learning operating system
CC PPTS unit-I PPT Notes of Cloud Computing
IMDb_Product_Teardown_product_management
ForSee by Languify Teardown final product management
Application of smart robotics in the supply chain
Snapchat product teardown product management
highway-150803160405-lva1-app6891 (1).pptx
02. INDUSTRIAL REVOLUTION & Cultural, Technical and territorial transformatio...
Computer Networks and Internet Protocol Week-1
Soumya Das post quantum crypot algorithm
Project_Mgmt_Institute_- Marc Marc Marc.pdf
Retail.pptx internet of things mtech 2 nd sem
Operating systems-POS-U1.2.pdf cse gghhu
IoT-Based Hybrid Renewable Energy System.pdf
Downstream processing_in Module1_25.pptx
ITEC 1010 - Information and Organizations Database System and Big data

RxJS - The Reactive Extensions for JavaScript