Last active
January 14, 2018 20:55
-
-
Save hugoangeles0810/d5e3281ae0ed474304768253d34c4429 to your computer and use it in GitHub Desktop.
Ejemplo de dependencias
This file contains hidden or 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
| 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