Skip to content

Instantly share code, notes, and snippets.

@alaershov
Created June 4, 2019 17:04
Show Gist options
  • Save alaershov/5eac25ef8717a17e4a279b4656a14ba7 to your computer and use it in GitHub Desktop.
Save alaershov/5eac25ef8717a17e4a279b4656a14ba7 to your computer and use it in GitHub Desktop.
Toothpick: User repository with no DI
public final class UserRepository {
private final SharedPreferences sharedPreferences;
public UserRepository(SharedPreferences sharedPreferences) {
this.sharedPreferences = sharedPreferences;
}
public User getUser() {
// ...
}
public void saveUser(User user) {
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment