Created
January 15, 2018 00:16
-
-
Save hugoangeles0810/30e4eca15e7f97892d7ad8d89143dc0e to your computer and use it in GitHub Desktop.
Uso de inyección 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, val sqliteDataSource: SQLiteDataSource) { | |
| 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