All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.dev.programadorthi.routing.compose.ComposeContent.kt Maven / Gradle / Ivy

There is a newer version: 2.0.0-alpha02
Show newest version
package dev.programadorthi.routing.compose

import androidx.compose.runtime.Composable
import dev.programadorthi.routing.core.application.ApplicationCall
import io.ktor.util.AttributeKey

internal typealias ComposeContent = @Composable (ApplicationCall) -> Unit

private val ComposeRoutingContentAttributeKey: AttributeKey =
    AttributeKey("ComposeRoutingContentAttributeKey")

internal var ApplicationCall.content: ComposeContent?
    get() = attributes.getOrNull(ComposeRoutingContentAttributeKey)
    set(value) {
        if (value != null) {
            attributes.put(ComposeRoutingContentAttributeKey, value)
        } else {
            attributes.remove(ComposeRoutingContentAttributeKey)
        }
    }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy