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
850
Unidux 0.3.1
mattak
1
360
Other Decks in Programming
See All in Programming
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
Amazon Qを使ってIaCを触ろう!
maruto
0
410
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
Realtime API 入門
riofujimon
0
150
Remix on Hono on Cloudflare Workers
yusukebe
1
300
cmp.Or に感動した
otakakot
3
200
距離関数を極める! / SESSIONS 2024
gam0022
0
290
最新TCAキャッチアップ
0si43
0
190
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Thoughts on Productivity
jonyablonski
67
4.3k
Agile that works and the tools we love
rasmusluckow
327
21k
The Cult of Friendly URLs
andyhume
78
6k
Why Our Code Smells
bkeepers
PRO
334
57k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
GitHub's CSS Performance
jonrohan
1030
460k
What's new in Ruby 2.0
geeforr
343
31k
Building an army of robots
kneath
302
43k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
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 DPNQPTJUF4VCTDSJQUJPOVOTVCTDSJCF // Ұؾʹunsubscribe͢Δͱ͖ʹศར
5.onErrorResumeNext -ɹerrorΛແࢹ͍ͨ͠ -
QVCMJDPCKFDU3FTPVSDFT&SS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