Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目中的RxJava2可以用kotlin的协程替换掉,代码更简洁 #3

Closed
ikakaxi opened this issue Nov 8, 2018 · 3 comments
Closed

Comments

@ikakaxi
Copy link

ikakaxi commented Nov 8, 2018

如题,我计划用kotlin的协程替换掉目前项目里的RxJava2,现在协程已经是正式版了

@qingmei2
Copy link
Owner

qingmei2 commented Nov 8, 2018

@ikakaxi

这是一个非常棒的建议,协程的整体替换也在我下一步的计划中。

这需要一段时间的发展,因为我认为目前协程还没有发展足够的生态环境——我更期待更多类似 retrofit2-kotlin-coroutines-adapter这样的拓展库,能够让我下决定把所有RxJava的代码给替换掉。

目前项目中,Room,网络请求以及Databinding依赖的LiveData,都是通过RxJava进行编织串在一起的,这些代码糅合很深,因此Kotlin1.3发布后,我只先尝试性的使用了类似 Result 这样的API在异常处理上代替Arrow的Either。

因为我还没有开始着手学习协程,从新手角度来看,可能还需要一段时间学习深入理解协程,因此我更期待关于协程的相关分享和分析。

非常期待您的实践。 👍

@ikakaxi
Copy link
Author

ikakaxi commented Nov 9, 2018

OK,问题关闭吧,我也在学习中,正在学习您的源码,打算用MVVP+JetPack组件+kotlin协程把目前的项目重构一遍

@qingmei2
Copy link
Owner

qingmei2 commented Nov 9, 2018

ok

@qingmei2 qingmei2 closed this as completed Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants