Last active
January 8, 2020 12:03
-
-
Save alaershov/fd4e8868ac3217b526967b4c8150f7c7 to your computer and use it in GitHub Desktop.
Toothpick: sample Module
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
public final class RepositoryModule extends Module { | |
public RepositoryModule(Context context) { | |
SharedPreferences sharedPreferences = context.getSharedPreferences("app.prefs", MODE_PRIVATE); | |
bind(SharedPreferences.class).toInstance(sharedPreferences); | |
bind(UserRepository.class) | |
.to(PrefUserRepository.class) | |
.singleton(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment