on

inline fun <C : Any> DIAware.on(context: C, trigger: DITrigger? = this.diTrigger): DI

Allows to create a new DI object with a context and/or a trigger set.

Return

A DI object that uses the same container as this one, but with its context and/or trigger changed.

Parameters

context

The new context of the new DI.

trigger

The new trigger of the new DI.


inline fun <C : Any> DIAware.on(trigger: DITrigger? = this.diTrigger, crossinline getContext: () -> C): DI

Allows to create a new DI object with a context and/or a trigger set.

Return

A DI object that uses the same container as this one, but with its context and/or trigger changed.

Parameters

getContext

A function that gets the new context of the new DI.

trigger

The new trigger of the new DI.


fun DIAware.on(trigger: DITrigger?): DI

Allows to create a new DI object with a trigger set.

Return

A DI object that uses the same container as this one, but with its context and/or trigger changed.

Parameters

trigger

The new trigger of the new DI.


inline fun <C : Any> DirectDIAware.on(context: C): DirectDI

Returns a DirectDI with its context and/or receiver changed.

Parameters

context

The new context for the new DirectDI.

receiver

The new receiver for the new DirectDI.