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
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
useSyncExternalStoreを使いまくる
ssssota
6
1k
快速入門可觀測性
blueswen
0
330
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
190
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
Zoneless Testing
rainerhahnekamp
0
120
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
330
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
130
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
700
たのしいparse.y
ydah
3
120
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
690
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
Featured
See All Featured
Designing for Performance
lara
604
68k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Making the Leap to Tech Lead
cromwellryan
133
9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
A designer walks into a library…
pauljervisheath
204
24k
The Cult of Friendly URLs
andyhume
78
6.1k
Building Applications with DynamoDB
mza
91
6.1k
Rails Girls Zürich Keynote
gr2m
94
13k
Making Projects Easy
brettharned
116
5.9k
Writing Fast Ruby
sferik
628
61k
The Language of Interfaces
destraynor
154
24k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
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Λແࢹ͍ͨ͠ -
QVCMJDPCK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