Skip to content

Instantly share code, notes, and snippets.

@hugoangeles0810
Last active January 14, 2018 20:55
Show Gist options
  • Select an option

  • Save hugoangeles0810/d5e3281ae0ed474304768253d34c4429 to your computer and use it in GitHub Desktop.

Select an option

Save hugoangeles0810/d5e3281ae0ed474304768253d34c4429 to your computer and use it in GitHub Desktop.
Ejemplo de dependencias
class ColorsRepository() {
val restDataSource = RestDataSource() // <-- Es una dependencia
val sqliteDataSource = SQLiteDataSource() // <-- Es una dependencia
fun listColors(): List<Color> {
val colors = restDataSource.listColor()
sqliteDataSource.saveOrUpdateColors(colors)
return colors
}
fun listLocalColors(): List<Color> {
return sqliteDataSource.listColors()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment