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
250
UnixTime is Simple
mattak
0
170
おっさんが停滞しないために
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
770
Unity energy usage
mattak
0
860
Unidux 0.3.1
mattak
1
370
Other Decks in Programming
See All in Programming
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
130
良いユニットテストを書こう
mototakatsu
8
2.3k
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
Zoneless Testing
rainerhahnekamp
0
120
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
770
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
命名をリントする
chiroruxx
1
410
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
5
1.2k
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
280
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Agile that works and the tools we love
rasmusluckow
328
21k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
98
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Adopting Sorbet at Scale
ufuk
73
9.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Building an army of robots
kneath
302
44k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
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 TVCTDSJQ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