Skip to content

Instantly share code, notes, and snippets.

@catalinghita8
Last active August 10, 2020 17:25
Show Gist options
  • Select an option

  • Save catalinghita8/7999aaf30350f983f248243e55eb6cdc to your computer and use it in GitHub Desktop.

Select an option

Save catalinghita8/7999aaf30350f983f248243e55eb6cdc to your computer and use it in GitHub Desktop.
class WeatherListFragment: Fragment() {
fun onCreate() {
val repo = WeatherRepository(LocalDataClient(LocalDataBase()),
InMemoryDataClient(MemoryCache()),
RemoteDataClient(RetrofitCLient()))
val vm = DataViewModel(repo)
}
}
class WeatherItemDetailsFragment: Fragment() {
fun onCreate() {
val repo = WeatherRepository(LocalDataClient(LocalDataBase()),
InMemoryDataClient(MemoryCache()),
RemoteDataClient(RetrofitCLient()))
val vm = DataViewModel(repo)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment