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
RxJSで時空を制した話
Search
Jun Tomioka
July 14, 2016
Programming
3
790
RxJSで時空を制した話
RxJSで時空を制した話@M3techmeetup
http://m3-engineer.connpass.com/event/33802/
Jun Tomioka
July 14, 2016
Tweet
Share
More Decks by Jun Tomioka
See All by Jun Tomioka
Dotty で軽量な DI ライブラリをかいてみた
jooohn
1
280
ソフトウェアエンジニアとしてモナドを完全に理解する / make-perfect-sense-of-monad
jooohn
14
7.5k
ScalaのコンパイラにFizzBuzzを解いてもらう(Dottyもあるよ)
jooohn
1
940
Write stack safe non-tailrec recursive functions
jooohn
4
860
Introduction to Clean Architecture
jooohn
1
530
人類には早すぎる、謎の計算ロジックに立ち向かう / Strugle with the most complicated logic ever
jooohn
1
1.6k
Work at M3 USA
jooohn
0
1.2k
クラウド電子カルテを支えるテクノロジーの光と闇
jooohn
0
1.2k
怖くないCats
jooohn
0
720
Other Decks in Programming
See All in Programming
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
役立つログに取り組もう
irof
28
9.6k
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
as(型アサーション)を書く前にできること
marokanatani
9
2.6k
距離関数を極める! / SESSIONS 2024
gam0022
0
280
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
580
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
Jakarta EE meets AI
ivargrimstad
0
130
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Outline View in SwiftUI
1024jp
1
320
Featured
See All Featured
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Designing the Hi-DPI Web
ddemaree
280
34k
Documentation Writing (for coders)
carmenintech
65
4.4k
Teambox: Starting and Learning
jrom
133
8.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Automating Front-end Workflow
addyosmani
1366
200k
Optimizing for Happiness
mojombo
376
70k
How to Ace a Technical Interview
jacobian
276
23k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Fireside Chat
paigeccino
34
3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Transcript
RxJSͰۭ࣌Λ੍ͨ͠ M3, Inc. Jun Tomioka
ࣗݾհ Ԭ ७ (@jooohn) - ΤϜεϦʔגࣜձࣾ - ΤϯδχΞϦϯάG - ৽نϓϩδΣΫτx2
(ॾࣄʹΑΓඇެ։த) - ՇͷാͱؒΛͱͬͯڮຊ͔ Β̎h௨ۈʢڠٞதʣ
RxJSͰۭ࣌Λ੍ͨ͠
ॾࣄʹΑΓ αʔϏε༰Λݴ͑ͳ͍ͷͰ ԾͷαʔϏεͰઆ໌͠·͢
https://github.com/jooohn/rx-angular-example
ۭ࣌Λ੍͢Δલ https://goo.gl/1wlYCu
ۭ࣌Λ੍͍ͤͯͳ͍ • Ϣʔβʔ͕ૢ࡞͢ΔɺͨΒୟ͔ΕΔAPIίʔϧ • λΠϛϯάʹΑۭ͕ͬͯ࣌Ή • Load Moreͷॱ൪ • લճͷݕࡧ݁ՌΫϦΞ
• ݹ͍݅ͷݕࡧ݁ՌΛදࣔʂʂ
ʰjʱͰݕࡧ ʰjaʱͰݕࡧ ʰjaʱͷ݁Ռ ʰjʱͷ݁Ռ ۭ࣌ͷΈ
ۭ࣌ͷΈ
ͭΒ͍
ͦ͜Ͱ
None
None
An API for asynchronous programming with observable streams ࠓճॏཁͳ
None
Αͦ͞͏
ۭ࣌Λ੍͍ͤͯͳ͍ • Ϣʔβʔ͕ૢ࡞͢ΔɺͨΒୟ͔ΕΔAPIίʔϧ • λΠϛϯάʹΑۭ͕ͬͯ࣌Ή
ۭ࣌Λ੍͍ͤͯͳ͍ • Ϣʔβʔ͕ૢ࡞͢ΔɺͨΒୟ͔ΕΔAPIίʔϧ • λΠϛϯάʹΑۭ͕ͬͯ࣌Ή
combineLatest
ݕࡧΩʔϫʔυͷετϦʔϜ େͷετϦʔϜ “” “j” “ja” Asia Europe combineLatest “” /
Asia “j” / Asia “ja” / Asia “ja” / Europe ݕࡧ݅ͷετϦʔϜ
ݕࡧ݅ͷ ετϦʔϜΛ ҰຊԽ
debounce
debounce debounce(300) ݕࡧ݅ͷετϦʔϜ 300msҎʹଞͷΠϕϯτ͕͋ΔͷΛഉআ
debounce debounce(300) ݕࡧ݅ͷετϦʔϜ ࿈ଧɾΩʔλΠϓͰͷແବͳϦΫΤετΛݮʂ
ۭ࣌Λ੍͍ͤͯͳ͍ • Ϣʔβʔ͕ૢ࡞͢ΔɺͨΒୟ͔ΕΔAPIίʔϧ • λΠϛϯάʹΑۭ͕ͬͯ࣌Ή
ۭ࣌Λ੍͍ͤͯͳ͍ • Ϣʔβʔ͕ૢ࡞͢ΔɺͨΒୟ͔ΕΔAPIίʔϧ • λΠϛϯάʹΑۭ͕ͬͯ࣌Ή
flatMapLatest
͜Ε͚ͩ
flatMap
flatMapLatest
flatMapLatest ݅A ݅B ݅C ݅D flatMapLatest(݅ => ݁ՌͷετϦʔϜ) ݁ՌA ݁ՌB
݁ՌC ݁ՌD
flatMapLatest ݅A ݅B ݅C ݅D flatMapLatest(݅ => ݁ՌͷετϦʔϜ) ݁ՌA ݁ՌB
݁ՌC ݁ՌD ۭ͕࣌·ͳ͍
ۭ͕࣌·ͳ͍ʂ
flatMapLatest
͜Ε͚ͩͰ
ۭ͕࣌·ͳ͍ʂ
ۭ࣌Λ੍͍ͤͯͳ͍ • Ϣʔβʔ͕ૢ࡞͢ΔɺͨΒୟ͔ΕΔAPIίʔϧ • λΠϛϯάʹΑۭ͕ͬͯ࣌Ή
https://goo.gl/7phFXe
ۭ࣌Λ੍ͨ͠ʂ