ragdroid/Dahaka

Why do we need activity scope?

chaitanya-exp opened this issue · 2 comments

We need new presenter on every activity creation anyways. If it is to handle activity recreation then the associated component will also be recreated which in turns results in new presenter object.

@chaitanya-exp It is for demonstration purposes, In future there can be a few dependencies which will live during the scope of for example just HomeActivity, like HomeActivityRouter (which can manage navigation between various fragments within HomeActivity, same instance can be injected into all three fragments but for a different activity I would still create a new Router. There could be multiple such examples. Here's just to demonstrate how we can do this.

Thanks for the clarification. All the dagger related repos seem to use activity, fragment scope in their examples without a suitable usecase.