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

commonMain.internal.actions.HasAction.kt Maven / Gradle / Ivy

There is a newer version: 0.23.0
Show newest version
package io.kform.internal.actions

import io.kform.AbsolutePath
import io.kform.FormManager
import kotlinx.coroutines.flow.firstOrNull

/** Action that returns whether a value exists matching [path]. */
internal class HasAction(formManager: FormManager, path: AbsolutePath) :
    ReadValueStateAction(formManager, path) {
    override fun toString() = "Has($path)"

    override suspend fun run() = valueInfo(path).firstOrNull() != null
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy