4

I'm building an app following an MVP pattern where I create each presenter using Dagger2 and all is well.

I went with Firebase and I noticed that in each of my presenters, I have the same dependencies

  1. Database
  2. Database Refrence
  3. FirebaseAuth
  4. FirebaseAuth.AuthStateListener
  5. FirebaseUser

As well as all the listeners and call backs. Now, im creating a user creation flow and in each of my presenters that will be reused for a settings configuration down the road.

My problem is that I cant quite wrap my head around injecting these references, because the state changes as the user uses my app. There wont be a FirebaseUser upon first login, so im unsure how Dagger2 would update this dependency, or insure the proper callback listeners are engaged.

Any tips?

AL.
  • 36,815
  • 10
  • 142
  • 281

0 Answers0