Package-level declarations

Types

Link copied to clipboard

Interface with the available methods to manage injections

Link copied to clipboard
class InjectorJS(injector: InjectorController)

Wrapper for Injector to be used from the JS (pure js)

Link copied to clipboard
class InjectorJVM(injector: InjectorController)

Wrapper for Injector to be used from the JVM (pure java)

Link copied to clipboard
interface InjectorManager

Interface with the available methods to manage injections

Link copied to clipboard
class InjectorObjC(injector: InjectorController)

Wrapper for Injector to be used from the ObjectiveC (pure objc)

Link copied to clipboard

Compatibility class to use PopKorn from java code Use it like PopKornCompat.inject(class)

Link copied to clipboard
expect class WeakReference<T : Any>(referred: T)

Methods/Classes used in library that are Platform-dependent

actual typealias WeakReference = WeakReference<T>
actual class WeakReference<T : Any>(referred: T)
actual typealias WeakReference = WeakReference<T>
actual typealias WeakReference = WeakReference<T>

Implementation for Native of the methods/classes that are Platform-dependent

Functions

Link copied to clipboard
inline fun <T : Any> inject(environment: String? = null, noinline config: InjectorConfig.Builder.() -> Unit? = null): T

Methods to inject instances anywhere like inject()

Link copied to clipboard
fun <T : Any> KClass<T>.inject(environment: String? = null, config: InjectorConfig.Builder.() -> Unit? = null): T
Link copied to clipboard
inline fun <T : Any> injecting(environment: String? = null, noinline config: InjectorConfig.Builder.() -> Unit? = null): Lazy<T>
Link copied to clipboard
inline fun <T : Any> injectOrNull(environment: String? = null, noinline config: InjectorConfig.Builder.() -> Unit? = null): T?

Methods to inject nullable instances anywhere like injectOrNull()

Link copied to clipboard
fun <T : Any> KClass<T>.injectOrNull(environment: String? = null, config: InjectorConfig.Builder.() -> Unit? = null): T?
Link copied to clipboard
Link copied to clipboard

Method to obtain the default injector currently being used

Link copied to clipboard
inline fun <T : Any> popkorn(environment: String? = null, noinline config: InjectorConfig.Builder.() -> Unit? = null): Lazy<T>

Methods to lazy inject instances anywhere like: val instance by popkorn() val instance by injecting()

setup
Link copied to clipboard
fun setup(creator: (ObjCClass) -> Mapping)

This method needs to be called on IOS platform before using PopKorn. This is because from Kotlin cannot instantiate a class with "class_createInstance(ObjCClass, 0) as? Mapping". So we need the ios to provide a lambda of how to create an object

fun setup(resolvers: Set<Mapping>, providers: Set<Mapping>)

Secondary method to initialize popkorn from IOS in case the first doesn't work

fun setup(resolvers: Set<Mapping>, providers: Set<Mapping>)

This method needs to be called on JS platform before using PopKorn. This is because in js cannot automatically locate the mapping files

fun setup(resolvers: Set<Mapping>, providers: Set<Mapping>)

This method needs to be called on Native platform before using PopKorn. This is because in native cannot automatically locate the mapping files

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard