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

Reloading remembered enums #39

Open
sellmair opened this issue Dec 5, 2024 · 0 comments
Open

Reloading remembered enums #39

sellmair opened this issue Dec 5, 2024 · 0 comments
Assignees

Comments

@sellmair
Copy link
Member

sellmair commented Dec 5, 2024

Sample code

enum class FileViewTab {
    RuntimeInfo,
    Javap
}

@Composable
fun FileView() {
    val file = OpenedFileState.composeValue() ?: return
    var selectedTab by remember { mutableStateOf(FileViewTab.RuntimeInfo) }
    
    Column {
        Text(file.path.pathString)

        TabRow(FileViewTab.entries.indexOf(selectedTab), modifier = Modifier) {

might lead to the indexOf call returning -1.
This indicates that we need to invalidate all composables using this enum, when the enum was redefined.

@sellmair sellmair self-assigned this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant