CircuitContext

class CircuitContext constructor(val parent: CircuitContext?, tags: MutableMap<KClass<*>, Any> = mutableMapOf())(source)

A CircuitContext is used in Presenter.Factory and Ui.Factory to inform creation of their respective Presenter and Ui instances.

Available information includes:

Constructors

Link copied to clipboard
constructor(parent: CircuitContext?, tags: MutableMap<KClass<*>, Any> = mutableMapOf())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun clearTags()

Clears all the current tags.

Link copied to clipboard
inline fun <T : Any> putTag(tag: T?)

Attaches tag to the request using T as a key. Tags can be read from a request using CircuitContext.tag. Use null to remove any existing tag assigned for T.

fun <S : Any, T : S> putTag(type: KClass<S>, tag: T?)

Attaches tag to the request using type as a key. Tags can be read from a request using CircuitContext.tag. Use null to remove any existing tag assigned for type.

Link copied to clipboard
inline fun <T : Any> tag(): T?

Returns the tag attached with T as a key, or null if no tag is attached with that key.

fun <T : Any> tag(type: KClass<T>): T?

Returns the tag attached with type as a key, or null if no tag is attached with that key.