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

commonMain.com.seiko.imageloader.intercept.MappedInterceptor.kt Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
package com.seiko.imageloader.intercept

import com.seiko.imageloader.model.ImageResult
import com.seiko.imageloader.util.d

class MappedInterceptor : Interceptor {
    override suspend fun intercept(chain: Interceptor.Chain): ImageResult {
        val request = chain.request
        val options = chain.options
        val logger = chain.config.logger

        val mappedData = chain.components.map(request.data, options)
        logger.d(
            tag = "MappedInterceptor",
            data = request.data,
        ) { "map -> $mappedData" }

        val newRequest = request.newBuilder { data(mappedData) }
        return chain.proceed(newRequest)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy