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

commonMain.org.kodein.di.curry.kt Maven / Gradle / Ivy

There is a newer version: 7.22.0
Show newest version
package org.kodein.di

/**
 * Transforms a factory function into a provider function by currying the factory with the given argument.
 *
 * @param A The type of argument the factory takes.
 * @param T The type of object to retrieve.
 * @receiver The factory to curry.
 * @param arg A function that provides the argument that will be passed to the factory.
 * @return A provider function that, when called, will call the receiver factory with the given argument.
 */
public inline fun  ((A) -> T).toProvider(crossinline arg: () -> A): () -> T = { invoke(arg()) }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy