-
Notifications
You must be signed in to change notification settings - Fork 174
[ДЗ | Dagger 2] - Егор Шкляревский #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
antonkazakov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Привет. Оставил несколько коментариев
| class FragmentProducer : Fragment() { | ||
|
|
||
| @Inject | ||
| lateinit var application: Application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем тебе этот инжект?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А, это я просто пробовал) уберу
| @Module | ||
| object ColorGeneratorModule { | ||
|
|
||
| @Provides |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это нужно заменить на binds
| @Module | ||
| object ViewModelReceiverModule { | ||
|
|
||
| @Provides |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тоже можно поменять на binds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Немного не понимаю как, я же тут из параметров создаю вьюмодель. По мне биндс не подходит
Можете по подробнее описать?
| class FragmentReceiver : Fragment() { | ||
|
|
||
| @Inject | ||
| lateinit var application: Application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем нужен этот инжект?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А, это я просто пробовал) уберу
| private val context: Context | ||
| class ViewModelReceiver @Inject constructor( | ||
| private val context: Context, | ||
| private val colorFlow: MutableStateFlow<Int> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь лучше инжектить иммутабельную версию
No description provided.