erikghonyan / RxJavaRetrofitAdapter

RxJava 3 adapter for Retrofit 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RxJavaRetrofitAdapter

RxJava 3 adapter for Retrofit 2

Port of Retrofit/RxJava2 adapter: https://github.com/square/retrofit/tree/master/retrofit-adapters/rxjava2

codecov.io Maven Central

Retrofit 2: Maven Central

RxJava 3: Maven Central

dependencies {
    implementation "com.github.akarnokd:rxjava3-retrofit-adapter:3.0.0"
}

Usage

import retrofit2.*;
import hu.akarnokd.rxjava3.retrofit.*;
import io.reactivex.rxjava3.core.*;

Retrofit retrofit = new Retrofit.Builder()
    .baseUrl("https://example.com/")
    .addCallAdapterFactory(RxJava3CallAdapterFactory.create())
    .build();

interface MyService {
  @GET("/user")
  Observable<User> getUser();
}

About

RxJava 3 adapter for Retrofit 2

License:Apache License 2.0


Languages

Language:Java 100.0%