Skip to content

Conversation

@jeghor
Copy link

@jeghor jeghor commented Nov 19, 2024

No description provided.

Copy link
Contributor

@antonkazakov antonkazakov left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем тебе этот инжект?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А, это я просто пробовал) уберу

@Module
object ColorGeneratorModule {

@Provides
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тоже можно поменять на binds

Copy link
Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем нужен этот инжект?

Copy link
Author

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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь лучше инжектить иммутабельную версию

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants