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
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
CSC509 Lecture 11
javiergs
PRO
0
180
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
890
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
初めてDefinitelyTypedにPRを出した話
syumai
0
400
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
Arm移行タイムアタック
qnighy
0
320
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
860
Building Applications with DynamoDB
mza
90
6.1k
For a Future-Friendly Web
brad_frost
175
9.4k
Facilitating Awesome Meetings
lara
50
6.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
A Tale of Four Properties
chriscoyier
156
23k
Thoughts on Productivity
jonyablonski
67
4.3k
Adopting Sorbet at Scale
ufuk
73
9.1k
Statistics for Hackers
jakevdp
796
220k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
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 DPNQPTJUF4VCTDSJQUJPOVOTVC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