KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
retrofit-adapter-flow
★ 18
Open GitHub ↗
retrofit-adapter-flow
Download README (.md)
Explore Similar Repositories
CVE-2020-12078
:
The official exploit for Open-AudIT v3.3.1 Remote Code Execution CVE-2020-12078
play_with_siguza_first_0day
:
a toy to play with siguza's very first 0 day - sandbox escape
fdet
:
An easy to use face detection module based on MTCNN and RetinaFace algorithms.
jitsynth
:
No description available.
snapraid_sync
:
Helper script for automating the SnapRAID sync and scrub. Use cron to trigger it on a schedule, and have it notify you by email.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
retrofit-adapter-flow
?
Download (.md)
[](https://jitpack.io/#chenxyu/retrofit-adapter-flow) `Retrofit` 返回 `Flow<out T>` # 依赖版本 | Dependency | Version | |--|--| | kotlin | 1.5.21 | | kotlinx-coroutines-android | 1.5.1 | | retrofit | 2.9.0 | # Gradle 依赖 1.root build.gradle ```kotlin allprojects { repositories { ... maven { url "https://jitpack.io" } } } ``` 2.app build.gradle ```kotlin dependencies { implementation 'com.github.chenxyu:retrofit-adapter-flow:1.2.0' } ``` # 使用方法 ```kotlin @POST(API.LOGIN) fun login(@Body any: Any): Flow<User> Retrofit.Builder() ... .addCallAdapterFactory(FlowCallAdapterFactory.create()) .build() lifecycleScope.launch(Dispatchers.Main) { githubService.search("kotlinx.coroutines") .flowOn(Dispatchers.IO) .catch { e -> if (e is CancellationException) { Toast.makeText(this@MainActivity, e.message, Toast.LENGTH_LONG).show() } }.collect { textView.text = it } } ```