commonMain.internal.actions.ValueInfoAction.kt Maven / Gradle / Ivy
package io.kform.internal.actions
import io.kform.AbsolutePath
import io.kform.FormManager
import io.kform.ValueInfoHandler
/**
* Action that calls [infoHandler] with the value-info of values at [path] and holds a lock over
* said info until [infoHandler] finishes.
*/
internal class ValueInfoAction(
formManager: FormManager,
path: AbsolutePath,
val infoHandler: ValueInfoHandler
) : ReadValueStateAction(formManager, path) {
override fun toString() = "ValueInfo($path)"
override suspend fun run() = infoHandler(valueInfo(path))
}