Skip to content
This repository has been archived by the owner on Jun 26, 2019. It is now read-only.

Commit

Permalink
Updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoxh committed Feb 12, 2018
1 parent 5b0073d commit b7c207f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ Add `LiveDataCallAdapterFactory` as a `Call` adapter when building your `Retrofi
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://example.com")
.addCallAdapterFactory(LiveDataCallAdapterFactory.create())
.addConverterFactory(LiveDataResponseBodyConverterFactory.wrap(new AnyConverterFactory()))
.build();
```

Your service methods can now use `LiveData` as their return type.
Your service methods can now use `LiveData` as their return type, but, note that we also have
a `LiveDataResponseBodyConverterFactory` this wrapper is necessary when you have a converter
that touch on the return type like `moshi` or `gson`, to bypass the `Resource<T>` class
and give to the `Converter.Factory` the correct type to serialize.

```java
public interface SuperService {
Expand Down Expand Up @@ -45,7 +49,7 @@ Gradle dependencie
---
```groovy
dependencies {
implementation "com.github.leonardoxh:retrofit2-livedata-adapter:1.0.0"
implementation "com.github.leonardoxh:retrofit2-livedata-adapter:1.0.1"
}
```

Expand All @@ -54,11 +58,6 @@ Inspiration
* [Kotlin courtines adapter](https://github.com/JakeWharton/retrofit2-kotlin-coroutines-adapter)
* [Retrofit RXJava2 adapter](https://github.com/square/retrofit)

Disclaimer
---
This library is not intended to be used in production yet, there is some limitations using this library with other converters like `moshi`
the next versions should fix it

License
---
```
Expand Down

0 comments on commit b7c207f

Please sign in to comment.