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
Tyrannosaurus Rx
Search
James Hughes
September 03, 2014
Programming
0
110
Tyrannosaurus Rx
Basic overview of Rx (Reactive Extensions)
James Hughes
September 03, 2014
Tweet
Share
More Decks by James Hughes
See All by James Hughes
Functional Programming with Clojure
kouphax
1
100
React
kouphax
2
690
Play for (Java|Scala)
kouphax
0
110
Devops: A Case Study
kouphax
0
67
Scala for C# Developers
kouphax
5
2.5k
Dropwizard - Production Ready Web Services
kouphax
3
1.5k
Scala for Fun & Profit
kouphax
3
610
What Agile Means To Me
kouphax
0
120
Neo4J: A Case Study
kouphax
3
600
Other Decks in Programming
See All in Programming
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
580
現場で役立つモデリング 超入門
masuda220
PRO
15
3.2k
Jakarta EE meets AI
ivargrimstad
0
510
RubyLSPのマルチバイト文字対応
notfounds
0
120
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Better Code Design in PHP
afilina
PRO
0
120
Click-free releases & the making of a CLI app
oheyadam
2
110
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
870
Featured
See All Featured
Ruby is Unlike a Banana
tanoku
97
11k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
How to Ace a Technical Interview
jacobian
276
23k
Bash Introduction
62gerente
608
210k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Optimizing for Happiness
mojombo
376
70k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
A Tale of Four Properties
chriscoyier
156
23k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Transcript
TYRANNOSAURUS RX
REACTIVE EXTENSIONS
None
Java JS C# Clojure Groovy Scala Kotlin Python Ruby C++
Haskell
var list = [1,2,3,4,5,6,7]; ! for(var i = 0; i
< list.length; i++) { console.log(list[i]) }
var list = [1,2,3,4,5,6,7]; ! list.forEach(function(item) { console.log(item) })
var list = [Promise(), Promise()…]; ! list.forEach(function(item) { console.log(item.get()) })
TIME RUINS EVERYTHING
None
None
None
OBSERVABLES LISTS WITH TIME REIFIED EVENT STREAM PUSH BASED
CREATING OBSERVABLES ITERABLE FUTURE/PROMISE EVENTS RULES OBSERVABLE
CREATING OBSERVABLES Observable.from(new String[] { "The Joker", "The Riddler", "Penguin",
"Catwoman"})
CREATING OBSERVABLES baddies.subscribe((baddie) -> { out.println(baddie + “ is bad.”)
})
CREATING OBSERVABLES The Joker is bad. The Riddler is bad.
Penguin is bad. Catwoman is bad.
CREATING OBSERVABLES class _ extends Subscriber<String> { void onCompleted() {}
void onError(Throwable t) {} void onNext(String s){} }
CREATING OBSERVABLES onNext("The Joker”)
CREATING OBSERVABLES onNext("The Joker”) onNext("The Riddler”)
CREATING OBSERVABLES onNext("The Joker”) onNext("The Riddler”) onNext(“Penguin")
CREATING OBSERVABLES onNext("The Joker”) onNext("The Riddler”) onNext(“Penguin") onNext(“Catwoman")
CREATING OBSERVABLES onCompleted() onNext("The Joker”) onNext("The Riddler”) onNext(“Penguin") onNext(“Catwoman")
ERROR HANDLING onNext("The Joker”)
onNext("The Joker”) onNext("The Riddler”) ERROR HANDLING
X onNext("The Joker”) onNext("The Riddler”) ERROR HANDLING
X onNext("The Joker”) onNext("The Riddler”) onError(ex) ERROR HANDLING
TRANSFORMING OBSERVABLES TURN AN OBSERVABLE OF ONE TYPE INTO ANOTHER
TRANSFORMING OBSERVABLES Observable ints = Observable .interval(1, SECONDS); ! ints.map((i)
-> i + 1) .map((i) -> i + “ seconds”) .subscribe(out::println)
TRANSFORMING OBSERVABLES map map
TRANSFORMING OBSERVABLES 1 seconds 2 seconds 3 seconds 4 seconds
...
TRANSFORMING OBSERVABLES flatMap(), groupBy(), buffer(), window()
FILTERING OBSERVABLES SELECT AND REJECT ITEMS EMITTED BY AN OBSERVABLE
FILTERING OBSERVABLES var keys = Rx.DOM.keypress(el) var ints = keys.filter(isNumeric)
! ints.subscribe(console.log)
FILTERING OBSERVABLES filter X X
FILTERING OBSERVABLES distinct(), timeout(), ignoreElements(), throttleFirst(), debounce(), sample(), first(), last(),
take(), skip()
COMBINING OBSERVABLES COMPOSING MULTIPLE OBSERVABLES INTO A SINGLE OBSERVABLE
COMBINING OBSERVABLES Observable goodies = Observable.from( new String[]{ "Batman", "Robin",
"Alfred", “Batgirl"}); ! goodies.zipWith(baddies, (g,b) -> g + " punches " + b)
COMBINING OBSERVABLES zipWith
COMBINING OBSERVABLES Batman punches The Joker Robin punches The Riddler
Alfred punches Penguin Batgirl punches Catwoman
STUFF AND OTHER THINGS retry(), delay(), timestamp(), amb(), defaultIfEmpty(), reduce(),
count()
None
TYRANNOSAURUS RX