commonMain.com.seiko.imageloader.option.AsyncSizeResolver.kt Maven / Gradle / Ivy
package com.seiko.imageloader.option
import androidx.compose.ui.geometry.Size
import kotlinx.coroutines.CompletableDeferred
class AsyncSizeResolver : SizeResolver {
private val sizeObserver = CompletableDeferred()
override suspend fun size(): Size {
return sizeObserver.await()
}
fun setSize(size: Size) {
sizeObserver.complete(size)
}
}