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
RxNight
Search
mattak
November 19, 2015
Programming
0
110
RxNight
2015-11-19
mattak
November 19, 2015
Tweet
Share
More Decks by mattak
See All by mattak
最近やった作業環境改善施策10個
mattak
0
240
UnixTime is Simple
mattak
0
160
おっさんが停滞しないために
mattak
32
18k
tech invest
mattak
1
300
Nodux - node base redux framework
mattak
0
1.4k
what_is_technical_investment
mattak
0
120
unitypackage distribution
mattak
0
760
Unity energy usage
mattak
0
840
Unidux 0.3.1
mattak
1
360
Other Decks in Programming
See All in Programming
Nuxtベースの「WXT」でChrome拡張を作成する | Vue Fes 2024 ランチセッション
moshi1121
1
510
Go言語でターミナルフレンドリーなAIコマンド、afaを作った/fukuokago20_afa
monochromegane
2
140
破壊せよ!データ破壊駆動で考えるドメインモデリング / data-destroy-driven
minodriven
16
4k
CSC305 Lecture 13
javiergs
PRO
0
130
Identifying User Idenity
moro
6
7.8k
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
2.7k
Pinia Colada が実現するスマートな非同期処理
naokihaba
2
160
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
970
gopls を改造したら開発生産性が高まった
satorunooshie
8
240
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
7
2.8k
Vaporモードを大規模サービスに最速導入して学びを共有する
kazukishimamoto
4
4.3k
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.6k
Designing for Performance
lara
604
68k
The Pragmatic Product Professional
lauravandoore
31
6.3k
It's Worth the Effort
3n
183
27k
Statistics for Hackers
jakevdp
796
220k
Navigating Team Friction
lara
183
14k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
The Cult of Friendly URLs
andyhume
78
6k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Transcript
Reactive Practices at Kotlin 2015/11/05 RxNight @mattak
RxJava+KotlinͰͷ tipsհ͢ΔΑ
1.notNull() -ɹnullͰͳ͍ͷΛ௨͢ -
%FpOJUJPO GVO50CTFSWBCMF5 OPU/VMM 0CTFSWBCMF5\ SFUVSOUIJTpMUFS\JUOVMM^NBQ\JU^ ^ 6TBHF WBMPCTFSWBCMF0CTFSWBCMFKVTU OVMM
OPU/VMM PCTFSWBCMFTVCTDSJCF\ QSJOUMO JU ^
2.retry() -ɹࣦഊͯ͠·ͨsubscribe -
CVUUPO$MJDL qBU.BQ\OFUXPSL3FRVFTU ^ࣦഊ͢ΔͱAPO&SSPS A SFUSZ PO&SSPS͕ݺΕͯSFUSZͰ࠶ͼTVCTDSJCF͞ΕΔ TVCTDSJCF\ PO/FYU࣌ͷॲཧ ^
3.doOnNext() -ɹ෭࡞༻Λ༩͑Δ -
0CTFSWBCMFKVTU EP0O/FYU\-PHW %( PO/FYU JU
^ EP0O&SSPS\-PHW %( PO&SSPS JU ^ EP0O$PNQMFUFE\-PHW %( PO$PNQMFUFE ^ EP0O&BDI\-PHW %( PO&BDI JU ^ TVCTDSJCF\^ // σόοΫ͢Δͱ͖ʹศར
4.CompositeSubscription -ɹsubscriptionΛ·ͱΊΔ -
WBMTVCTDSJQUJPO0CTFSWBCMFKVTU TVCTDSJCF\^ WBMTVCTDSJQUJPO0CTFSWBCMFKVTU B C D TVCTDSJCF\^
WBMDPNQPTJUF4VCTDSJQUJPO$PNQPTJUF4VCTDSJQUJPO DPNQPTJUF4VCTDSJQUJPOBEE TVCTDSJQUJPO DPNQPTJUF4VCTDSJQUJPOBEE TVCTDSJQUJPO DPNQPTJUF4VCTDS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