Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Functional Reactive Programming
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Jason Orendorff
March 30, 2013
Programming
1k
9
Share
Functional Reactive Programming
Slides for a talk by Wilkes Joiner at Nashville Code Co-op Talk Day.
Jason Orendorff
March 30, 2013
More Decks by Jason Orendorff
See All by Jason Orendorff
Aristotle's Topics
jorendorff
0
170
Meltdown & Spectre
jorendorff
0
130
<textarea distributed>: An illustrated intro to CRDTs
jorendorff
0
99
Cabbages, Goat, and Wolf In Two Styles!!
jorendorff
0
95
John Wark — Design Principles for a High School Coding Curriculum
jorendorff
1
140
Teaching Programming
jorendorff
2
180
goto fail; — Challenges and Considerations for Teaching Programming to Kids
jorendorff
1
100
How To Fix Bugs
jorendorff
0
140
Compilers 101: An introduction to programming languages and parsing
jorendorff
3
830
Other Decks in Programming
See All in Programming
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
130
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
150
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
3
220
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
770
ふつうのFeature Flag実践入門
irof
7
3.4k
LLM Plugin for Node-REDの利用方法と開発について
404background
0
150
Swiftのレキシカルスコープ管理
kntkymt
0
210
次世代リンターで探る、tsgo 時代における型認識カスタムルールの現実解
ytakahashii
3
1.4k
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.8k
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
420
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
1
210
net-httpのHTTP/2対応について
naruse
0
410
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
150
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.5k
The Curse of the Amulet
leimatthew05
1
13k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
How GitHub (no longer) Works
holman
316
150k
Fireside Chat
paigeccino
42
3.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Cost Of JavaScript in 2023
addyosmani
55
10k
GitHub's CSS Performance
jonrohan
1033
470k
Transcript
Functional Reactive Programming
“Everything flows, nothing stands still.” Heraclitus
Streams of Events
Streams of Events • Fire and forget events are relatively
easy to create.
Streams of Events • Fire and forget events are relatively
easy to create. • UIs
Streams of Events • Fire and forget events are relatively
easy to create. • UIs • Ajax posts
Streams of Events • Fire and forget events are relatively
easy to create. • UIs • Ajax posts • Messaging queues
Processing Events
Processing Events • A little trickier
Processing Events • A little trickier • difficult to compose
Processing Events • A little trickier • difficult to compose
• lots of plumbing
Processing Events • A little trickier • difficult to compose
• lots of plumbing • Callback Hell
“We’re going to need a bigger boat.”
FRP • A model for values that vary over time
• Originates from Haskell Community • Several different implementation styles • We are focusing on Microsoft’s ReactiveExtenions style
Observable
Observable • A marriage of Iterables and the Observer Pattern
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling • Timing function - Delay
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling • Timing function - Delay • Buffering - Last N events
Observable • A marriage of Iterables and the Observer Pattern
• Typical Sequence functions - Map, Filter, Reduce, Take • Subscribe/OnNext • Error Handling • Timing function - Delay • Buffering - Last N events • Composable - SelectMany/FlatMap
Marble Diagrams
A Marble Diagrams
A Marble Diagrams
A B Marble Diagrams
A B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
A B A.merge(B Marble Diagrams
Autocomplete • On Keyup • Get the value of the
field • Only values of length 3 or more • Make remote call • Filter out bad response • Display results
Autocomplete in reality • On Keyup • Get the value
of the field • Throttle to 500ms • Only values of length 3 or more • Skip duplicates • Make remote call • Filter out bad response • Display results
Demo Source code: https://github.com/Cicayda/yolk-examples