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
- Database
- Database Refrence
- FirebaseAuth
- FirebaseAuth.AuthStateListener
- 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?