SlideShare a Scribd company logo
Reactive Extensions for JavaScript@JimWooleyhttp://www.ThinqLinq.comConsultant
Reactive Framework“Rx is a library for composingasynchronousandevent-based operations using observable collections.”
Reactive Framework“RxJsis a library for composingasynchronousandevent-based operations using observable prototypes.”
Observable Collection - Common Uses
Flavors of RxRxJs
IEnumerator vs. IObserverpublic interface IEnumerator{   object Current { get; }   bool MoveNext();   void Reset();}Blockingpublic interface IObserver<T>{    void OnCompleted();    void OnError(Exception exception);    void OnNext(T value);}
LINQ for Javascript?C# Query Syntaxvar query = from c in Customers                    where c.City == "Chattanooga“                    select c.Name; C# Lambda Syntaxvar query = Customers                    .Where(c => c.City == "Chattanooga")                    .Select(c => c.Name);JavaScriptvar query = Customers                    .Where(function (c) { return c.City === “Chattanooga” ; })                    .Select(function (c) { return c.Name; });
Using Rx to query in Javascriptdemo
Rx Observable Pattern        var obs = ...;        // query?        var sub = obs.Subscribe(            onNext : v => DoSomething(v),            onError : e => HandleError(e),            onCompleted : () => HandleDone);        sub.Dispose();
RxJs Observable Pattern        var obs = ...;       // query?       var sub = obs.Subscribe(            function(v) { DoSomething(v); },            function(e) { HandleError(e); },            function() { HandleDone(); });        sub.Dispose();
var geo = Rx.Observable.Create(function (observer) { var watchId = navigator.geolocation.watchPosition(        function (pos) { observer.OnNext(pos.coords);  },       function (err) { observer.OnError(err);  }   );       return function () {         navigator.geolocation.clearWatch(watchId);    };});var d = geo.Subscribe(function(pos)  {  alert(pos);  });…d.Dispose();Observable.Create86753098675309
RX.Observable.PrototypeGeneratorFlowQuerySelectLetWhereTakeSkipGroupByDoCatchFinallyOnErrorResumeNextFlowScanDistinctUntilChangedReplaySkipLastTakeLastSubscribeDematerializeAsObservsablePublishStartsWithMergeMergeObservableConcatZipCombineLatestSwitchSelectManyTakeWhileTakeUntilSkipUntilPruneTime       TimeIntervalRemoveIntervalRemoveTimestampBufferWithTimeBufferWithCountThrottleSampleRepeatRetryTimeoutDelay
Factory GeneratorsRx.Observable.Range(0,5);Rx.Observable.Return(“This is a single value”);Rx.Observable.FromArray([“a”, “b”, “c”]);Rx.Observable.Timer(1000,2000);Rx.Observable.Create(function(subscriber) { return  function() { unsub() }});Rx.Observable.FromDOMEvent(Document.GetElementById(“image”), “mousemove”);Rx.Observable.FromJQuery($(“div,, span”), “click”);$(“div, span”).ToObservable(“click”);Rx.Obsevable.XmlHttpRequest(url);
DemoGenerating Observables
Combining streams
SelectManyvarObservableY = ObservableX.SelectMany(function(x) { SomeGenerator(x); });OxfxfxfxOyOyOyOy
TakeUntiloXoYoX
Observable EventsFirst Class Objects
Standardize event model
Disposable
Supports DI
MockableComposing with Eventsdemo
Asynchronous Service RequestsThrottleBingTranslatorTranslateObservableXTakeUntil
Asynchronous Servicesdemo
Why RxJs?Reuse LINQ knowledge

More Related Content

PDF
RxJS - The Reactive Extensions for JavaScript
Viliam Elischer
 
PPTX
Reactive Programming and RxJS
Denis Gorbunov
 
PPTX
Intro to RxJS
Alan Fadliawan
 
PDF
My Gentle Introduction to RxJS
Mattia Occhiuto
 
PPTX
RxJs
Akila Iroshan
 
PDF
Reactive programming using rx java & akka actors - pdx-scala - june 2014
Thomas Lockney
 
PPTX
RxJS and Reactive Programming - Modern Web UI - May 2015
Ben Lesh
 
PDF
SF Front End Developers - Ember + D3
Ben Lesh
 
RxJS - The Reactive Extensions for JavaScript
Viliam Elischer
 
Reactive Programming and RxJS
Denis Gorbunov
 
Intro to RxJS
Alan Fadliawan
 
My Gentle Introduction to RxJS
Mattia Occhiuto
 
Reactive programming using rx java & akka actors - pdx-scala - june 2014
Thomas Lockney
 
RxJS and Reactive Programming - Modern Web UI - May 2015
Ben Lesh
 
SF Front End Developers - Ember + D3
Ben Lesh
 

What's hot (20)

PPTX
Javantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PPTX
Intro to Functional Programming with RxJava
Mike Nakhimovich
 
PPTX
Introduction to RxJava on Android
Chris Arriola
 
PDF
Streams, Streams Everywhere! An Introduction to Rx
Andrzej Sitek
 
PDF
RxJava@Android
Maxim Volgin
 
PPTX
Reactive
Pranav E K
 
PPTX
Introduction to Reactive programming
Dwi Randy Herdinanto
 
PDF
Reactive programming with RxJava
Jobaer Chowdhury
 
PDF
Building Scalable Stateless Applications with RxJava
Rick Warren
 
PDF
An Introduction to Reactive Cocoa
SmartLogic
 
PDF
The Mayans Lost Guide to RxJava on Android
Fernando Cejas
 
PDF
Journey into Reactive Streams and Akka Streams
Kevin Webber
 
PDF
Reactive programming with Rxjava
Christophe Marchal
 
PPTX
Till Rohrmann – Fault Tolerance and Job Recovery in Apache Flink
Flink Forward
 
PDF
Gpars - the coolest bits
Artur Gajowy
 
PDF
Flink Forward SF 2017: Kenneth Knowles - Back to Sessions overview
Flink Forward
 
PPTX
Spring batch in action
Mohammed Shoaib
 
PPTX
Going Reactive with Spring 5
Drazen Nikolic
 
PDF
The Future starts with a Promise
Alexandru Nedelcu
 
ODP
Scala Future & Promises
Knoldus Inc.
 
Javantura v3 - Going Reactive with RxJava – Hrvoje Crnjak
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Intro to Functional Programming with RxJava
Mike Nakhimovich
 
Introduction to RxJava on Android
Chris Arriola
 
Streams, Streams Everywhere! An Introduction to Rx
Andrzej Sitek
 
RxJava@Android
Maxim Volgin
 
Reactive
Pranav E K
 
Introduction to Reactive programming
Dwi Randy Herdinanto
 
Reactive programming with RxJava
Jobaer Chowdhury
 
Building Scalable Stateless Applications with RxJava
Rick Warren
 
An Introduction to Reactive Cocoa
SmartLogic
 
The Mayans Lost Guide to RxJava on Android
Fernando Cejas
 
Journey into Reactive Streams and Akka Streams
Kevin Webber
 
Reactive programming with Rxjava
Christophe Marchal
 
Till Rohrmann – Fault Tolerance and Job Recovery in Apache Flink
Flink Forward
 
Gpars - the coolest bits
Artur Gajowy
 
Flink Forward SF 2017: Kenneth Knowles - Back to Sessions overview
Flink Forward
 
Spring batch in action
Mohammed Shoaib
 
Going Reactive with Spring 5
Drazen Nikolic
 
The Future starts with a Promise
Alexandru Nedelcu
 
Scala Future & Promises
Knoldus Inc.
 
Ad

Viewers also liked (20)

PPTX
Functional Reactive Programming with RxJS
stefanmayer13
 
PDF
Add Some Fun to Your Functional Programming With RXJS
Ryan Anklam
 
PDF
Rethink Async With RXJS
Ryan Anklam
 
PDF
RxJS Evolved
trxcllnt
 
PDF
RxJS - The Reactive extensions for JavaScript
Viliam Elischer
 
PDF
FRP with Ractive and RxJS
Alfonso Garcia-Caro
 
PDF
ReactiveX-SEA
Yang Yang
 
PDF
Progressive Web Apps
Kevin Dantas
 
PDF
Programação reativa com RxJS e Angular
Wendel Nascimento
 
PPTX
Reactive programming
Sunscrapers
 
PDF
RxJS 5 in Depth
C4Media
 
PDF
Functional Reactive Angular 2
Tomasz Bak
 
PDF
Functional Reactive Programming / Compositional Event Systems
Leonardo Borges
 
PPTX
Angular2 + rxjs
Christoffer Noring
 
PPTX
Rxjs ngvikings
Christoffer Noring
 
PPTX
Rxjs ppt
Christoffer Noring
 
PPTX
Material Design - do smartphone ao desktop
Hillary Sousa
 
PDF
WebApps com Web Components
Beto Muniz
 
PDF
Polymer and Firebase: Componentizing the Web in Realtime
Juarez Filho
 
PDF
Polymer Starter Kit
Evaldo Barbosa
 
Functional Reactive Programming with RxJS
stefanmayer13
 
Add Some Fun to Your Functional Programming With RXJS
Ryan Anklam
 
Rethink Async With RXJS
Ryan Anklam
 
RxJS Evolved
trxcllnt
 
RxJS - The Reactive extensions for JavaScript
Viliam Elischer
 
FRP with Ractive and RxJS
Alfonso Garcia-Caro
 
ReactiveX-SEA
Yang Yang
 
Progressive Web Apps
Kevin Dantas
 
Programação reativa com RxJS e Angular
Wendel Nascimento
 
Reactive programming
Sunscrapers
 
RxJS 5 in Depth
C4Media
 
Functional Reactive Angular 2
Tomasz Bak
 
Functional Reactive Programming / Compositional Event Systems
Leonardo Borges
 
Angular2 + rxjs
Christoffer Noring
 
Rxjs ngvikings
Christoffer Noring
 
Material Design - do smartphone ao desktop
Hillary Sousa
 
WebApps com Web Components
Beto Muniz
 
Polymer and Firebase: Componentizing the Web in Realtime
Juarez Filho
 
Polymer Starter Kit
Evaldo Barbosa
 
Ad

Similar to Reactive Extensions for JavaScript (20)

PDF
Rxjava 介紹與 Android 中的 RxJava
Kros Huang
 
PPTX
Introduction to RxJS
Abul Hasan
 
PPTX
Ft10 de smet
nkaluva
 
PPTX
Reactive Programming with RxJS
Danca Prima
 
PPT
Reactive java programming for the impatient
Grant Steinfeld
 
PPTX
Reactive Extensions (Rx)
Mark Allan
 
PPTX
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
PROIDEA
 
PDF
ReactiveX
BADR
 
PDF
Integrating React.js Into a PHP Application
Andrew Rota
 
PPTX
Open sourcing the store
Mike Nakhimovich
 
PDF
Reactive in Android and Beyond Rx
Fabio Tiriticco
 
ODP
How to unit test your React/Redux app
Alin Pandichi
 
PPT
Ajax
rahmed_sct
 
PDF
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
VMware Tanzu
 
PDF
Javascript under the hood
Ridhwana Khan
 
PPTX
Rx java in action
Pratama Nur Wijaya
 
PDF
Ajax Under The Hood
WO Community
 
PDF
Spring 5 Webflux - Advances in Java 2018
Trayan Iliev
 
PPTX
Scala.js for large and complex frontend apps
Otto Chrons
 
PPTX
Reactive extensions itjam
Ciklum Ukraine
 
Rxjava 介紹與 Android 中的 RxJava
Kros Huang
 
Introduction to RxJS
Abul Hasan
 
Ft10 de smet
nkaluva
 
Reactive Programming with RxJS
Danca Prima
 
Reactive java programming for the impatient
Grant Steinfeld
 
Reactive Extensions (Rx)
Mark Allan
 
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...
PROIDEA
 
ReactiveX
BADR
 
Integrating React.js Into a PHP Application
Andrew Rota
 
Open sourcing the store
Mike Nakhimovich
 
Reactive in Android and Beyond Rx
Fabio Tiriticco
 
How to unit test your React/Redux app
Alin Pandichi
 
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
VMware Tanzu
 
Javascript under the hood
Ridhwana Khan
 
Rx java in action
Pratama Nur Wijaya
 
Ajax Under The Hood
WO Community
 
Spring 5 Webflux - Advances in Java 2018
Trayan Iliev
 
Scala.js for large and complex frontend apps
Otto Chrons
 
Reactive extensions itjam
Ciklum Ukraine
 

More from Jim Wooley (8)

PPTX
Improving code quality with Roslyn analyzers
Jim Wooley
 
PPTX
Tearing down the //build/ 2016 conference
Jim Wooley
 
PPTX
Ssdt wooley
Jim Wooley
 
PPTX
Windows 8 as an Application Integration Hub
Jim Wooley
 
PPTX
Linq tools
Jim Wooley
 
PPTX
Entity Framework Migration
Jim Wooley
 
PPTX
Dynamic programming in a statically typed world
Jim Wooley
 
PPTX
Rx forwp7
Jim Wooley
 
Improving code quality with Roslyn analyzers
Jim Wooley
 
Tearing down the //build/ 2016 conference
Jim Wooley
 
Ssdt wooley
Jim Wooley
 
Windows 8 as an Application Integration Hub
Jim Wooley
 
Linq tools
Jim Wooley
 
Entity Framework Migration
Jim Wooley
 
Dynamic programming in a statically typed world
Jim Wooley
 
Rx forwp7
Jim Wooley
 

Recently uploaded (20)

PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Software Development Company | KodekX
KodekX
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PPT
Coupa-Kickoff-Meeting-Template presentai
annapureddyn
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Software Development Company | KodekX
KodekX
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Coupa-Kickoff-Meeting-Template presentai
annapureddyn
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 

Reactive Extensions for JavaScript