Example app which shows how to create UserScope in Dagger 2
Java
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
app initial commit Aug 13, 2016
gradle/wrapper initial commit Aug 13, 2016
.gitignore initial commit Aug 13, 2016
README.md Update README.md Sep 14, 2016
build.gradle updated dependencies Oct 16, 2016
gradle.properties initial commit Aug 13, 2016
gradlew initial commit Aug 13, 2016
gradlew.bat initial commit Aug 13, 2016
settings.gradle initial commit Aug 13, 2016

README.md

Dagger2Recipes: UserScope

Example app which shows how to create UserScope in Dagger 2


In theory all we have to do to create custom scope in Dagger 2 is:

  • Create scope annotation (e.g. @UserScope)
  • Create component which will keep scoped references (e.g. UserComponent).

But if we would like to use it in production Android app we need to care about Application/Activities lifecycles, restoring scope state between app launches, creating/keeping our custom component and much more.

Check blog post: Building UserScope with Dagger2 for more details.