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
Composing Reactive Software
Search
michaelavila
July 28, 2017
Programming
84
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Composing Reactive Software
michaelavila
July 28, 2017
More Decks by michaelavila
See All by michaelavila
Navigating in VIM
michaelavila
0
92
Other Decks in Programming
See All in Programming
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
180
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
2
330
霧の中の代数的エフェクト
funnyycat
1
450
What's New in Android 2026
veronikapj
0
240
Google Apps Script で Ruby を動かす
kawahara
0
120
AIが無かった頃の素敵な出会いの話
codmoninc
1
340
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
150
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
190
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
420
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
4
1.4k
Foundation Models frameworkで画像分析
ryodeveloper
1
320
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
1
260
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
3.9k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
190
Typedesign – Prime Four
hannesfritz
42
3.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.4k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
190
Odyssey Design
rkendrick25
PRO
2
740
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Product Roadmaps are Hard
iamctodd
55
12k
Test your architecture with Archunit
thirion
1
2.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
270
Chasing Engaging Ingredients in Design
codingconduct
0
250
GitHub's CSS Performance
jonrohan
1033
470k
Transcript
carbonfive.com Composing Reactive Software Michael Avila •
[email protected]
Agenda • Insufficient overview • Important, but poorly explained idea
• Vague and unjustified conclusion • Questions
Agenda (revised) • Reactive Programming • Signal Graph • Conclusion
• Questions
Reactive Programming
“... programming with asynchronous data streams ...”
interface Observable<T> { subscribe( onNext: (T) => void, onError: (Error)
=> void, onCompleted: () => void, ): Subscription; map( (T) => V): Observable<V>; flatMap((T) => Observable<V>): Observable<V>; scan( (V, T) => V, V): Observable<V>; filter( (T) => boolean): Observable<T>; withLatestFrom(Observable<V>, ...): Observable<[T, V, ...]>; combineLatest( Observable<V>, ...): Observable<[T, V, ...]>; … any many more! }
Operators buffer bufferCount bufferTime bufferToggle bufferWhen combineAll combineLatest concat concatAll
concatMap concatMapTo count debounce debounceTime defaultIfEmpty delay delayWhen dematerialize distinctUntilChanged do every expand filter first groupBy ignoreElements last let map mapTo merge mergeMap partition pluck publish race repeat retry retryWhen sample scan share single skip skipUntil skipWhile startWith switchMap window windowCount windowTime windowToggle windowWhen withLatestFrom zip … and probably more
const email$ = Observable.fromEvent(...<input/>...); const password$ = Observable.fromEvent(...<input/>...); const login$
= Observable.fromEvent(...<button/>...); const activeUser = login$ .withLatestFrom(email$, password$) .flatMap(([_, email, password]) => { return Observable.ajax.post('/auth/', { email, password }) .map(({ response }) => response); }); activeUser.subscribe(...<div>...);
None
None
None
Signal Graph
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
Additional Notes ➔ Asynchronous ➔ Lazy* ➔ Composable
None
Good?
None
¯\_(ツ)_/¯
Good! I think.
carbonfive.com Thanks!