Created
July 13, 2019 17:03
-
-
Save harmittaa/0ec6b2479447b23c1682802fa88ecee5 to your computer and use it in GitHub Desktop.
Koin 2.0 and Retrofit 2.6.0 example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.github.harmittaa.koinexample.networking.WeatherApi | |
import org.koin.dsl.module | |
val forecastModule = module { | |
factory { WeatherRepository(get()) } | |
} | |
class WeatherRepository(private val weatherApi: WeatherApi) { | |
suspend fun getWeather() = weatherApi.getForecast() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment