INNER CODE UNIT · Kotlin

produceState

komikku-app/komikku · app/src/main/java/exh/debug/SettingsDebugScreen.kt:93

        val toggles by produceState(initialValue = persistentListOf()) {
            value = withContext(Dispatchers.Default) {
                DebugToggles.entries.map { DebugToggle(it.name, it.asPref(scope), it.default) }.toImmutableList()
            }
        }
        Scaffold(
            topBar = { scrollBehavior ->
                AppBar(
                    title = "DEBUG MENU",
                    scrollBehavior = scrollBehavior,
                )
            },
        ) { paddingValues ->
            Crossfade(functions == null, label = "debug_functions") {
                when (it) {
                    true -> LoadingScreen()
                    false -> FunctionList(paddingValues, functions ?: persistentListOf(), toggles, scope)
                }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…