set

operator fun set(key: String, value: Any)(source)

Adds a key-value pair to the context using indexed access notation.

Example:

context {
this[ContextKeys.USER_ID] = "user-123"
}

Parameters

key

The parameter key

value

The value to associate with the key