lastData

@JvmName(name = "lastDataWithType")
inline fun <T : Transmission.Data> lastData(): T?

Returns the last data transmission of the specified type.

This is useful for asserting on the final state of a transformer after processing.

Return

The last data of type T, or null if none exists

Example:

val userData = lastData<UserData.LoggedIn>()
assertNotNull(userData)
assertEquals("john", userData.username)

Parameters

T

The type of data to retrieve


Returns the last data transmission of any type.

Return

The last data transmission, or null if none exists