eric-ampire / android-mvi-architecture

23 stars 7 forks source link

pass parameter in api #1

Open haris15 opened 4 years ago

haris15 commented 4 years ago

Greate tutorial my friend, i have question how can i pass parameter in retrofit api using this architecture ?

eric-ampire commented 4 years ago

If you are speaking about query parameter, you can do something like this

interface UserApi {

    @GET("users/{id}")
    suspend fun getUserById(@Path("id") id: Long) : User
}
haris15 commented 4 years ago

No using Intent to viewmodel