SlideShare a Scribd company logo
REACTIVE PROGRAMMING
INTRODUCTION TO
REACTIVE PROGRAMMING
WHAT IS REACTIVE PROGRAMMING?
There are plenty of bad explanation and definitions out there
on the internet:
▸ Wikipedia - is to generic and theoretical as usual.
▸ Stackoverflow’s - canonical answer is obviously not suitable for newcomers.
▸ Reactive Manifesto - sounds like the kind of … job position?
▸ Microsoft RX - is so heavy and Microsoftish that most of us are left confused.
REACTIVE PROGRAMMING
WHAT IS REACTIVE PROGRAMMING?
There are plenty of bad explanation and definitions out there
on the internet:
▸ Wikipedia - is to generic and theoretical as usual.
▸ Stackoverflow’s - canonical answer is obviously not suitable for newcomers.
▸ Reactive Manifesto - sounds like the kind of … job position?
▸ Microsoft RX - is so heavy and Microsoftish that most of us are left confused.
REACTIVE PROGRAMMING
WHAT IS REACTIVE PROGRAMMING?
My definition is:
▸ Reactive programming is programming with asynchronous
data streams.
In a way, this isn't anything new.
Event buses or your typical click events are really an asynchronous event stream, on which
you can observe and do some side effects.
Reactive is that idea on steroids. You are able to create data streams of anything, not just
from click and hover events. Streams are cheap and ubiquitous, can be a stream: variables,
user inputs, properties, caches, data structures, etc
CLICKS ON A
BUTTON
EVENT STREAM
REACTIVE PROGRAMMING
YOU CAN LISTEN TO THAT STREAM AND REACT ACCORDINGLY.
On top of that, you are given an amazing toolbox of functions to combine, create and filter any
of those streams. That's where the "functional" magic kicks in.
A stream can be used as an input to another one.
Even multiple streams can be used as inputs to another stream.
You can merge two streams.
You can filter a stream to get another one that has only those events you are interested in.
You can map data values from one stream to another new one.
REACTIVE PROGRAMMING
A STREAM
A stream is a sequence of ongoing events ordered in time. It can emit three different things: a
value (of some type), an error, or a "completed" signal. Consider that the "completed" takes
place, for instance, when the current window or view containing that button is closed.
We capture these emitted events only asynchronously, by defining a function that will execute
when a value is emitted, another function when an error is emitted, and another function when
'completed' is emitted.
The "listening" to the stream is called subscribing. The functions we are defining are observers.
The stream is the subject (or "observable") being observed.
UNDERSTAND AND
BUILD STREAMS
THINKING IN DIAGRAMS
REACTIVE PROGRAMMING
“WHY SHOULD I CONSIDER ADOPTING RP?”
Reactive Programming raises the level of abstraction of your code so you can focus on the
interdependence of events that define the business logic, rather than having to constantly
fiddle with a large amount of implementation details. Code in RP will likely be more concise.
The benefit is more evident in modern webapps and mobile apps that are highly interactive
with a multitude of UI events related to data events.
Apps nowadays have an abundancy of real-time events of every kind that enable a highly
interactive experience to the user. We need tools for properly dealing with that, and Reactive
Programming is an answer.
Reactive programming - Observable
REACTIVE PROGRAMMING
“SO … DOES THIS MEAN THAT A PROMISE IS LIKE AN OBSERVABLE?”
Yes.
Observable is Promise++. In Rx you can easily convert a Promise to an Observable by doing
var stream = Rx.Observable.fromPromise(promise), so let's use that. The only difference is that
Observables are not Promises/A+ compliant, but conceptually there is no clash. A Promise is
simply an Observable with one single emitted value. Rx streams go beyond promises by
allowing many returned values.
This is pretty nice, and shows how Observables are at least as powerful as Promises.
ARRAY, OBJECT,
PROMISE,
OBSERVABLE
THE DIFFERENCE
BETWEEN
THANKS FOR WATCHING
DRAGOS IONITA
software engineer
https://ro.linkedin.com/in/dragos-ionita-8ab20756
REACTIVE PROGRAMMING

More Related Content

PDF
Reactive programming
PDF
Reactive programming and RxJS
PPTX
Functional reactive programming
PPTX
Reactive programming
PDF
Reactive: Programming -> Systems -> Architecture
PPTX
Reactive programming with rx java
PPTX
Reactive programming
PPTX
Reactive programming
Reactive programming
Reactive programming and RxJS
Functional reactive programming
Reactive programming
Reactive: Programming -> Systems -> Architecture
Reactive programming with rx java
Reactive programming
Reactive programming

What's hot (20)

PDF
Microservices with spring boot
PDF
Demystifying Reactive Programming
PDF
Reactive java - Reactive Programming + RxJava
PPTX
Reactive Programming In Java Using: Project Reactor
PDF
Declarative Concurrency with Reactive Programming
PPTX
Mule soft meetup__official__feb-27_2021
PPT
Building Reactive webapp with React/Flux
PPTX
Akka for big data developers
PDF
Advanced web application architecture - Talk
PPTX
New York City Meetup- 6th March 2021
PPTX
Flux and React.js
PPTX
Ratpack and Grails 3 GR8Conf US 2014
PPTX
Mule async scope
PDF
Interop 2015: Hardly Enough Theory, Barley Enough Code
PPTX
Performance tuning Grails Applications GR8Conf US 2014
PPT
PPTX
Why actor-based systems are the best for microservices
PPT
Cloud computing-2 (1)
PPTX
SignalR for ASP.NET Developers
PDF
MuleSoft Surat Virtual Meetup#27 - MuleSoft Runtime 4.4, Transit Gateway and ...
Microservices with spring boot
Demystifying Reactive Programming
Reactive java - Reactive Programming + RxJava
Reactive Programming In Java Using: Project Reactor
Declarative Concurrency with Reactive Programming
Mule soft meetup__official__feb-27_2021
Building Reactive webapp with React/Flux
Akka for big data developers
Advanced web application architecture - Talk
New York City Meetup- 6th March 2021
Flux and React.js
Ratpack and Grails 3 GR8Conf US 2014
Mule async scope
Interop 2015: Hardly Enough Theory, Barley Enough Code
Performance tuning Grails Applications GR8Conf US 2014
Why actor-based systems are the best for microservices
Cloud computing-2 (1)
SignalR for ASP.NET Developers
MuleSoft Surat Virtual Meetup#27 - MuleSoft Runtime 4.4, Transit Gateway and ...
Ad

Similar to Reactive programming - Observable (20)

PDF
Reactive Programming
PDF
Moving towards Reactive Programming
PPTX
Real world functional reactive programming
PPTX
Mario Fusco - Reactive programming in Java - Codemotion Milan 2017
PDF
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - ...
PPTX
PDF
[DevDay 2019] Reactive Programming with JavaScript - By Pham Nguyen Duc, Web ...
PPTX
RxJS vs RxJava: Intro
PDF
Reactive systems
PPTX
Reactive programming every day
PDF
PHP Reactive Programming at Medan Tech Day 2018
PPTX
Solve it Differently with Reactive Programming
PPTX
Functional Reactive Programming
PPTX
WTF is Reactive Programming
PDF
ReactiveX
PPTX
Mini training - Reactive Extensions (Rx)
PPTX
Functional Reactive Programming with RxJS
PPTX
Reactive Programming with RxJS
PDF
(Functional) reactive programming (@pavlobaron)
PDF
Embracing Reactive Streams with Java 9 and Spring 5
Reactive Programming
Moving towards Reactive Programming
Real world functional reactive programming
Mario Fusco - Reactive programming in Java - Codemotion Milan 2017
I have a stream - Insights in Reactive Programming - Jan Carsten Lohmuller - ...
[DevDay 2019] Reactive Programming with JavaScript - By Pham Nguyen Duc, Web ...
RxJS vs RxJava: Intro
Reactive systems
Reactive programming every day
PHP Reactive Programming at Medan Tech Day 2018
Solve it Differently with Reactive Programming
Functional Reactive Programming
WTF is Reactive Programming
ReactiveX
Mini training - Reactive Extensions (Rx)
Functional Reactive Programming with RxJS
Reactive Programming with RxJS
(Functional) reactive programming (@pavlobaron)
Embracing Reactive Streams with Java 9 and Spring 5
Ad

More from Dragos Ionita (7)

PDF
Adventures with Angular 2
PDF
The new way to write a frontend software
ODP
Robotics and Arduino (Arduino UNO)
PDF
Html5 - Awesome APIs
PDF
Hybrid Mobile Application with Ionic Framework
PDF
Powerful JavaScript Tips and Best Practices
PDF
Google Tag Manager (GTM)
Adventures with Angular 2
The new way to write a frontend software
Robotics and Arduino (Arduino UNO)
Html5 - Awesome APIs
Hybrid Mobile Application with Ionic Framework
Powerful JavaScript Tips and Best Practices
Google Tag Manager (GTM)

Recently uploaded (20)

PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Digital Strategies for Manufacturing Companies
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
DOCX
The Five Best AI Cover Tools in 2025.docx
PDF
medical staffing services at VALiNTRY
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
history of c programming in notes for students .pptx
PPTX
Materi_Pemrograman_Komputer-Looping.pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Transform Your Business with a Software ERP System
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Materi-Enum-and-Record-Data-Type (1).pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Digital Strategies for Manufacturing Companies
How Creative Agencies Leverage Project Management Software.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
The Five Best AI Cover Tools in 2025.docx
medical staffing services at VALiNTRY
Wondershare Filmora 15 Crack With Activation Key [2025
Upgrade and Innovation Strategies for SAP ERP Customers
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Design an Analysis of Algorithms II-SECS-1021-03
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Which alternative to Crystal Reports is best for small or large businesses.pdf
history of c programming in notes for students .pptx
Materi_Pemrograman_Komputer-Looping.pptx
PTS Company Brochure 2025 (1).pdf.......
Transform Your Business with a Software ERP System
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free

Reactive programming - Observable

  • 2. REACTIVE PROGRAMMING WHAT IS REACTIVE PROGRAMMING? There are plenty of bad explanation and definitions out there on the internet: ▸ Wikipedia - is to generic and theoretical as usual. ▸ Stackoverflow’s - canonical answer is obviously not suitable for newcomers. ▸ Reactive Manifesto - sounds like the kind of … job position? ▸ Microsoft RX - is so heavy and Microsoftish that most of us are left confused.
  • 3. REACTIVE PROGRAMMING WHAT IS REACTIVE PROGRAMMING? There are plenty of bad explanation and definitions out there on the internet: ▸ Wikipedia - is to generic and theoretical as usual. ▸ Stackoverflow’s - canonical answer is obviously not suitable for newcomers. ▸ Reactive Manifesto - sounds like the kind of … job position? ▸ Microsoft RX - is so heavy and Microsoftish that most of us are left confused.
  • 4. REACTIVE PROGRAMMING WHAT IS REACTIVE PROGRAMMING? My definition is: ▸ Reactive programming is programming with asynchronous data streams. In a way, this isn't anything new. Event buses or your typical click events are really an asynchronous event stream, on which you can observe and do some side effects. Reactive is that idea on steroids. You are able to create data streams of anything, not just from click and hover events. Streams are cheap and ubiquitous, can be a stream: variables, user inputs, properties, caches, data structures, etc
  • 6. REACTIVE PROGRAMMING YOU CAN LISTEN TO THAT STREAM AND REACT ACCORDINGLY. On top of that, you are given an amazing toolbox of functions to combine, create and filter any of those streams. That's where the "functional" magic kicks in. A stream can be used as an input to another one. Even multiple streams can be used as inputs to another stream. You can merge two streams. You can filter a stream to get another one that has only those events you are interested in. You can map data values from one stream to another new one.
  • 7. REACTIVE PROGRAMMING A STREAM A stream is a sequence of ongoing events ordered in time. It can emit three different things: a value (of some type), an error, or a "completed" signal. Consider that the "completed" takes place, for instance, when the current window or view containing that button is closed. We capture these emitted events only asynchronously, by defining a function that will execute when a value is emitted, another function when an error is emitted, and another function when 'completed' is emitted. The "listening" to the stream is called subscribing. The functions we are defining are observers. The stream is the subject (or "observable") being observed.
  • 9. REACTIVE PROGRAMMING “WHY SHOULD I CONSIDER ADOPTING RP?” Reactive Programming raises the level of abstraction of your code so you can focus on the interdependence of events that define the business logic, rather than having to constantly fiddle with a large amount of implementation details. Code in RP will likely be more concise. The benefit is more evident in modern webapps and mobile apps that are highly interactive with a multitude of UI events related to data events. Apps nowadays have an abundancy of real-time events of every kind that enable a highly interactive experience to the user. We need tools for properly dealing with that, and Reactive Programming is an answer.
  • 11. REACTIVE PROGRAMMING “SO … DOES THIS MEAN THAT A PROMISE IS LIKE AN OBSERVABLE?” Yes. Observable is Promise++. In Rx you can easily convert a Promise to an Observable by doing var stream = Rx.Observable.fromPromise(promise), so let's use that. The only difference is that Observables are not Promises/A+ compliant, but conceptually there is no clash. A Promise is simply an Observable with one single emitted value. Rx streams go beyond promises by allowing many returned values. This is pretty nice, and shows how Observables are at least as powerful as Promises.
  • 13. THANKS FOR WATCHING DRAGOS IONITA software engineer https://ro.linkedin.com/in/dragos-ionita-8ab20756 REACTIVE PROGRAMMING