commonMain.epsilon.ImageViewerUploaderFactory.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of epsilon-image-core Show documentation
Show all versions of epsilon-image-core Show documentation
A kotlin multiplatform library for headless image input uploads
package epsilon
import koncurrent.Later
import koncurrent.later.then
import koncurrent.later.andThen
import koncurrent.later.andZip
import koncurrent.later.zip
import koncurrent.later.catch
import epsilon.internal.ImageViewerUploaderImpl
fun ImageViewerUploader(
onUpload: ((RawFile) -> Later)? = null,
url: String? = null
): ImageViewerUploader {
val state = if (url != null) {
ViewingImage(url)
} else {
AwaitingImage
}
return ImageViewerUploaderImpl(state, onUpload)
}