Skip to content
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

feat(non-compose-accessors): add non compose accessors #40

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

humblerookie
Copy link

@humblerookie humblerookie commented Feb 18, 2024

Sometimes we may need to access strings beyond the compose framework.

This PR makes it easy to use it if needed. Resolves #38

Do let me know what you think of it.

@humblerookie
Copy link
Author

@DevNatan It would be nice if you could take a look at this.

@CodeIdeal
Copy link

CodeIdeal commented May 31, 2024

I suggest providing a property delegate method similar to strings for accessing outside of Compose scopes, which would be more convenient.

Like this (notic: the return type of strings is not $fileName, it's should be $stringsClassOutput):

val stringsProperty = if (config.generateStringsProperty) {
"""
|$visibility val strings: $fileName
| @Composable
| get() = Local$fileName.current
""".trimMargin()
} else {
""
}

@humblerookie
Copy link
Author

humblerookie commented May 31, 2024

@CodeIdeal This was intentional since delegates wouldn't allow accessing other locales than the default one.

@humblerookie
Copy link
Author

@adrielcafe @DevNatan Just wondering if anything more needs to be done on this, it would be nice to get some feedback on this PR.

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.

Support noncompose accessors
2 participants