Consumable

class Consumable<T : Any>

A result, delivered after a BackDestination carrying it was handled.

The result can be consumed exactly once: consume removes it from the result store and returns true. It returns false when the result was already consumed by another collector or expired. Concurrent calls are safe: only one call succeeds.

Observation is expected to be scoped to the destination's lifecycle (usually a ViewModel), so only the returning destination collects its result. The type exposes only value and consume, so application wrappers do not need to depend on navigation types to receive results.

Parameters

value

The delivered payload.

Properties

Link copied to clipboard
val value: T

Functions

Link copied to clipboard