Package-level declarations

Properties

Link copied to clipboard

DI container holder that can be shared and accessed across the Composable tree

Functions

Link copied to clipboard

Access the closest DI container attached to the Context

Link copied to clipboard

Composable helper function to access the current DI container from the Composable tree (if there is one!)

Link copied to clipboard
inline fun OnDIContext(context: DIContext<*>, crossinline content: @Composable () -> Unit)

Attaches a DI context to the underlying Composable tree

Link copied to clipboard
inline fun <C : Any> onDIContext(context: C, crossinline content: @Composable () -> Unit)

Attaches a DI context to the underlying Composable tree

Link copied to clipboard
inline fun <T : Any> rememberDI(vararg keys: Any?, noinline block: @DisallowComposableCalls DI.() -> LazyDelegate<T>): LazyDelegate<T>

Access DI container in a Composable tree and retrieve a T reference

Link copied to clipboard
inline fun <A : Any, T : Any> rememberFactory(tag: Any? = null): LazyDelegate<(A) -> T>

Retrieves and keeps a reference on a factory of T for the given argument type, return type and tag.

Link copied to clipboard
inline fun <T : Any> rememberInstance(tag: Any? = null): LazyDelegate<T>

Retrieves and keeps reference on an instance of T for the given type and tag.

inline fun <A : Any, T : Any> rememberInstance(tag: Any? = null, arg: A): LazyDelegate<T>

Retrieves and keeps a reference on an instance of T for the given type and tag, curried from a factory that takes an argument A.

inline fun <A : Any, T : Any> rememberInstance(tag: Any? = null, noinline fArg: () -> A): LazyDelegate<T>

Retrieves and keeps of T for the given type and tag, curried from a factory that takes an argument A.

Link copied to clipboard
inline fun <T : Any> rememberNamedInstance(): LazyDelegate<T>

Retrieves and keeps reference on a named instance of T for the given type and tag.

inline fun <A : Any, T : Any> rememberNamedInstance(arg: A): LazyDelegate<T>

Retrieves and keeps a reference on an instance of T for the given, curried from a factory that takes an argument A.

inline fun <A : Any, T : Any> rememberNamedInstance(noinline fArg: () -> A): LazyDelegate<T>

Retrieves and keeps a reference on an instance of T for the given fArg, curried from a factory that takes an argument A.

Link copied to clipboard
inline fun <T : Any> rememberProvider(tag: Any? = null): LazyDelegate<() -> T>

Retrieves and keeps a reference on a provider of T for the given type and tag.

inline fun <A : Any, T : Any> rememberProvider(tag: Any? = null, arg: A): LazyDelegate<() -> T>
inline fun <A : Any, T : Any> rememberProvider(tag: Any? = null, noinline fArg: () -> A): LazyDelegate<() -> T>

Retrieves and keeps a reference on a provider of T for the given type and tag, curried from a factory that takes an argument A.

Link copied to clipboard
inline fun subDI(allowSilentOverride: Boolean = false, copy: Copy = Copy.NonCached, noinline diBuilder: DI.MainBuilder.() -> Unit, crossinline content: @Composable () -> Unit)

Allows to create an extended version of the LocalDI container and attaches it to the underlying Composable tree

inline fun subDI(parentDI: DI, allowSilentOverride: Boolean = false, copy: Copy = Copy.NonCached, noinline diBuilder: DI.MainBuilder.() -> Unit, crossinline content: @Composable () -> Unit)

Allows to create an extended version of a given DI container and attaches it to the underlying Composable tree

Link copied to clipboard
inline fun withDI(noinline builder: DI.MainBuilder.() -> Unit, crossinline content: @Composable () -> Unit)
inline fun withDI(di: DI, crossinline content: @Composable () -> Unit)

Attaches a DI container to the underlying Composable tree

inline fun withDI(vararg diModules: DI.Module, crossinline content: @Composable () -> Unit)

Creates a DI container and imports DI.Modules before attaching it to the underlying Composable tree