Skip to content

Conversation

@EmogurovAnton
Copy link
Contributor

No description provided.

@Composable
@ReadOnlyComposable
public fun stringResource(text: TextValue): String {
val resources = resources()
Copy link

Choose a reason for hiding this comment

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

Просто ресурсы resources() выносить не имеет смысла,
либо все в return

return resources.getString(text)

либо

val string = resources().getString(text)
return string

Copy link
Collaborator

Choose a reason for hiding this comment

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

Он вынесен в отдельный метод по аналогии с реализацией оригинального stringResource. Имеет смысл ориентироваться на реализацию из Compose.

@Composable
@ReadOnlyComposable
private fun resources(): Resources {
LocalConfiguration.current
Copy link

Choose a reason for hiding this comment

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

зачем это нужно?

@Composable
@ReadOnlyComposable
public fun stringResource(text: TextValue): String {
val resources = resources()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Он вынесен в отдельный метод по аналогии с реализацией оригинального stringResource. Имеет смысл ориентироваться на реализацию из Compose.

osipxd
osipxd previously approved these changes Nov 5, 2024
Copy link
Collaborator

@osipxd osipxd left a comment

Choose a reason for hiding this comment

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

LGTM, one minor comment left

- [![Version](https://img.shields.io/maven-central/v/com.redmadrobot.gears/kotlin?style=flat-square&label=viewmodelevents-compose)][viewmodelevents-compose] — A set of extensions for dealing with ViewModelEvents inside `@Composable` functions
- [![Version](https://img.shields.io/maven-central/v/com.redmadrobot.gears/kotlin?style=flat-square&label=viewmodelevents-flow)][viewmodelevents-flow] — An implementation of ViewModelEvents via `Flow`
- [![Version](https://img.shields.io/maven-central/v/com.redmadrobot.gears/kotlin?style=flat-square&label=viewmodelevents-livedata)][viewmodelevents-livedata] — An implementation of ViewModelEvents via `LiveData`
`ViewModelEvents` addresses the challenge of buffering and consuming one-time events:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`ViewModelEvents` addresses the challenge of buffering and consuming one-time events:
`ViewModelEvents` addresses the challenge of buffering and consuming one-time events.

@EmogurovAnton EmogurovAnton requested review from TopHlop and removed request for Sx1a9z4f January 13, 2026 12:02
@EmogurovAnton
Copy link
Contributor Author

@osipxd, за 1.5 года контекст немного потерялся, по этому комментарию что-то нужно сделать?

@osipxd
Copy link
Collaborator

osipxd commented Jan 21, 2026

Кажется, что можно ничего не править

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.

5 participants