Created
November 27, 2017 13:54
-
-
Save masztalski/d6a6c07da40decd1c9e5736393aaf9fc to your computer and use it in GitHub Desktop.
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
@Module | |
public class RepositoryModule { | |
@Provides | |
@Singleton | |
ConnectionSource providesConnectionSource(Application app) { | |
return new AndroidConnectionSource(new DatabaseHelper(app.getApplicationContext())); | |
} | |
@Provides | |
@Singleton | |
UserRepository providesUserRepository(ConnectionSource connectionSource) { | |
return new UserSQLImpl(connectionSource); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment