kaungkhantsoe / NimbleTest

Technical Test for Nimble
1 stars 0 forks source link

Inject dependencies with Android Hilt #8

Closed hoangnguyen92dn closed 2 years ago

hoangnguyen92dn commented 2 years ago

It's a good point to see you are applying the Hilt for DI pattern on projects to manage dependencies. Besides that, I am wondering why do you need the TokenAuthenticatorEntryPoint inside the CustomAccessTokenInterceptor 🤔 It looks like a workaround solution to provide the preferenceManager and tokenRepo. Can we get rid of this and perform the injection when the class's instance is initialized instead?

https://github.com/kaungkhantsoe/NimbleTest/blob/dc472deabbd5c405e37def6289ef9822ed17cb5a/app/src/main/java/com/kks/nimbletest/util/interceptors/CustomAccessTokenInterceptor.kt#L33-L38

kaungkhantsoe commented 2 years ago

Yes, I was having dependency cycle when I was implementing that. I will fix it. Thanks for pointing that out.🤗