Created
June 4, 2019 17:40
-
-
Save alaershov/c42ec8ba159f1b2ded543532591fea75 to your computer and use it in GitHub Desktop.
Toothpick: bind to instance
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
public final class RepositoryModule extends Module { | |
public RepositoryModule(Context context) { | |
bind(UserRepository.class); | |
SharedPreferences sharedPreferences = context.getSharedPreferences("app.prefs", MODE_PRIVATE); | |
bind(SharedPreferences.class).toInstance(sharedPreferences); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment