Skip to content

Instantly share code, notes, and snippets.

@masztalski
Created November 27, 2017 13:54
Show Gist options
  • Save masztalski/d6a6c07da40decd1c9e5736393aaf9fc to your computer and use it in GitHub Desktop.
Save masztalski/d6a6c07da40decd1c9e5736393aaf9fc to your computer and use it in GitHub Desktop.
@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