shaohua-deng / Dagger2Recipes-UserScope

Example app which shows how to create UserScope in Dagger 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Example app which shows how to create UserScope in Dagger 2


Languages

Language:Java 100.0%