OnceEvent

class OnceEvent<out T : Any>(value: T)

The OnceEvent is an object containing a value that is to be consumed once and only once.

Example usage:

model.onNavigateHome.consume(this) {
// handle event
}

This class is not thread-safe.

Constructors

Link copied to clipboard
constructor(value: T)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun consume(): T?

Consume the non-null event.

Link copied to clipboard
fun peek(): T

Peek at the value of the event, not consuming.