SlideShare a Scribd company logo
1 of 50
Download to read offline
Reactive Thinking
fb.me/dangthaison.91 | @dangthaison91
Functional
Reactive
Programming
1. What is FRP?
Functional
+
Reactive
Microsoft Excel
a = b + c
FRP: Streams of values
over time
Core of FRP is Signal
Signal emits
value over the
time
FRP
is
Declarative
Imperative
Write correct sequence of codes in the correct
order. Step by step. (How)
Declarative
Write code to describes what you want to do.
2. Why is FRP?
Example 1
Search API as you type but:
- Don't spam API server every seconds
- Only make request if keyword changed
- Cancel previous requests
Imperative
Declarative
Example 2
When the user starts simultaneously panning and
rotating an object, start a countdown from 3.
Stop the timer either when the countdown ends
or when the user stops the gestures.
Imperative
Imperative
Imperative
- When the user touches the screen
- Check if a user is panning an object, store that information
- Check if both gestures are running simultaneously
- start a timer, from 3, counting down.
- Check if the user is rotating an object, store that information
- Check if both gestures are running simultaneously
- start a timer, from 3, counting down.
- Check if the user stopped panning
- Stop the timer if needed
- Check if the user stopped rotating
- Stop the timer if needed
- When the timer ticks, decrease the number of seconds left
- If the number of seconds left is zero, stop the timer*
There is a Better
Way!
Declarative
Declarative
Declarative
Declarative
Declarative
Declarative
Define condition “simultaneously `panning` and `rotating`”
Define condition “start a countdown from `3`”
Define condition “when the user stops the gestures”
Define what a timer is
When the user starts simultaneously `panning` and `rotating` an object, start a countdown from `3`.
Stop the timer either when the countdown ends or when the user stops the gestures.”
Advantages
• Code more concise & clear, easy to
understand without context
• Readability, highly express
• Make Asynchronous easier
• UI Binding
• Maintainability, Extensibility
...
Imperative
Declarative
What we can do
• Observables
• Transformations
• Composition
• Combination
• Filter
• Buffer
...
Denial
• FRP is hard, imperative is more easier
• FRP just is trend!
• Just another Framework
• Unnecessarily complex
3. Thinking in Reactive
FRP is hard, but it is
SIMPLE
Imperative is EASY
Simple
vs
Easy
Complexity
Simple made Easy
— Rick Hickey
FRP is good Trend
Functional Reactive
will be
RADIOACTIVE
More: https://goo.gl/lfNWlJ
Blog: https://dangthaison91.wordpress.com
Thank you!
Introduction to Functional Reactive Programming

More Related Content

What's hot

Converting LotusScript Agents to Java Agents
Converting LotusScript Agents to Java AgentsConverting LotusScript Agents to Java Agents
Converting LotusScript Agents to Java Agents
dominion
 

What's hot (20)

Redux
ReduxRedux
Redux
 
Async discussion 9_29_15
Async discussion 9_29_15Async discussion 9_29_15
Async discussion 9_29_15
 
Functional reactive programming
Functional reactive programmingFunctional reactive programming
Functional reactive programming
 
Task parallel library presentation
Task parallel library presentationTask parallel library presentation
Task parallel library presentation
 
Automation of Deep learning training with AWS Step Functions
Automation of Deep learning training with AWS Step FunctionsAutomation of Deep learning training with AWS Step Functions
Automation of Deep learning training with AWS Step Functions
 
Converting LotusScript Agents to Java Agents
Converting LotusScript Agents to Java AgentsConverting LotusScript Agents to Java Agents
Converting LotusScript Agents to Java Agents
 
Asynchronous Programming in C# - Part 1
Asynchronous Programming in C# - Part 1Asynchronous Programming in C# - Part 1
Asynchronous Programming in C# - Part 1
 
Akka (BeJUG)
Akka (BeJUG)Akka (BeJUG)
Akka (BeJUG)
 
Load test REST APIs using gatling
Load test REST APIs using gatlingLoad test REST APIs using gatling
Load test REST APIs using gatling
 
Introduction to actor model with examples on Akka.NET
Introduction to actor model with examples on Akka.NETIntroduction to actor model with examples on Akka.NET
Introduction to actor model with examples on Akka.NET
 
Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesAsynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & Promises
 
Akka framework
Akka frameworkAkka framework
Akka framework
 
Salesforce DUG - Queueable Apex
Salesforce DUG - Queueable ApexSalesforce DUG - Queueable Apex
Salesforce DUG - Queueable Apex
 
RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015
 
Variables in Pharo5
Variables in Pharo5Variables in Pharo5
Variables in Pharo5
 
SF Front End Developers - Ember + D3
SF Front End Developers - Ember + D3SF Front End Developers - Ember + D3
SF Front End Developers - Ember + D3
 
Top 10 RxJs Operators in Angular
Top 10 RxJs Operators in Angular Top 10 RxJs Operators in Angular
Top 10 RxJs Operators in Angular
 
Understanding react hooks
Understanding react hooksUnderstanding react hooks
Understanding react hooks
 
TDD in the Web with Python and Django
TDD in the Web with Python and DjangoTDD in the Web with Python and Django
TDD in the Web with Python and Django
 
Intro to Asynchronous Javascript
Intro to Asynchronous JavascriptIntro to Asynchronous Javascript
Intro to Asynchronous Javascript
 

Viewers also liked

"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)
AvitoTech
 

Viewers also liked (9)

Reactive programming with RxSwift
Reactive programming with RxSwiftReactive programming with RxSwift
Reactive programming with RxSwift
 
Data-Driven Product Development
Data-Driven Product DevelopmentData-Driven Product Development
Data-Driven Product Development
 
MVVM & RxSwift
MVVM & RxSwiftMVVM & RxSwift
MVVM & RxSwift
 
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)
 
IoC and Mapper in C#
IoC and Mapper in C#IoC and Mapper in C#
IoC and Mapper in C#
 
Building iOS App Project & Architecture
Building iOS App Project & ArchitectureBuilding iOS App Project & Architecture
Building iOS App Project & Architecture
 
How to Design Indexes, Really
How to Design Indexes, ReallyHow to Design Indexes, Really
How to Design Indexes, Really
 
Kafka and Storm - event processing in realtime
Kafka and Storm - event processing in realtimeKafka and Storm - event processing in realtime
Kafka and Storm - event processing in realtime
 
Dissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureDissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal Architecture
 

Similar to Introduction to Functional Reactive Programming

Archana Joshi Aug 2013 Kanban Spin Pune
Archana Joshi Aug 2013 Kanban Spin Pune Archana Joshi Aug 2013 Kanban Spin Pune
Archana Joshi Aug 2013 Kanban Spin Pune
Archana Joshi
 
classVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptxclassVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptx
ssusere336f4
 
Android activity
Android activityAndroid activity
Android activity
MohNage7
 

Similar to Introduction to Functional Reactive Programming (20)

Thinking Reactive
Thinking ReactiveThinking Reactive
Thinking Reactive
 
Reactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactorReactive solutions using java 9 and spring reactor
Reactive solutions using java 9 and spring reactor
 
Archana Joshi Aug 2013 Kanban Spin Pune
Archana Joshi Aug 2013 Kanban Spin Pune Archana Joshi Aug 2013 Kanban Spin Pune
Archana Joshi Aug 2013 Kanban Spin Pune
 
OOP -interface and objects.pptx
OOP -interface and objects.pptxOOP -interface and objects.pptx
OOP -interface and objects.pptx
 
Reactive programming with rx java
Reactive programming with rx javaReactive programming with rx java
Reactive programming with rx java
 
Microinteractions - Designing with Details
Microinteractions - Designing with DetailsMicrointeractions - Designing with Details
Microinteractions - Designing with Details
 
Web development basics (Part-6)
Web development basics (Part-6)Web development basics (Part-6)
Web development basics (Part-6)
 
Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014
Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014
Agile Intro and 2014 trends for AgileSparks open day at John-Bryce - March 2014
 
Striving for ultimate Low Latency
Striving for ultimate Low LatencyStriving for ultimate Low Latency
Striving for ultimate Low Latency
 
Getting Started with Akka Streams
Getting Started with Akka StreamsGetting Started with Akka Streams
Getting Started with Akka Streams
 
3. Product Development
3. Product Development3. Product Development
3. Product Development
 
Performance optimization for Android
Performance optimization for AndroidPerformance optimization for Android
Performance optimization for Android
 
Xp 2016 superchargeyourproductbacklogwithuserstories-suzannelaz
Xp 2016 superchargeyourproductbacklogwithuserstories-suzannelazXp 2016 superchargeyourproductbacklogwithuserstories-suzannelaz
Xp 2016 superchargeyourproductbacklogwithuserstories-suzannelaz
 
classVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptxclassVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptx
 
Client-side Development 2016
Client-side Development 2016Client-side Development 2016
Client-side Development 2016
 
Observables in Angular
Observables in AngularObservables in Angular
Observables in Angular
 
Conf2014_SearchHeadClustering
Conf2014_SearchHeadClusteringConf2014_SearchHeadClustering
Conf2014_SearchHeadClustering
 
Android activity
Android activityAndroid activity
Android activity
 
RxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android MontréalRxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android Montréal
 
Cloud Foundry Summit 2015: 12 Factor Apps For Operations
Cloud Foundry Summit 2015: 12 Factor Apps For OperationsCloud Foundry Summit 2015: 12 Factor Apps For Operations
Cloud Foundry Summit 2015: 12 Factor Apps For Operations
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Introduction to Functional Reactive Programming