AnsweringResultHandler

Handles result passing between navigation records.

This class maintains pending results for each record and tracks which result key each record is expecting. Foundation's rememberAnsweringResultHandler adds saveable-state persistence.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
suspend fun awaitResult(recordKey: String, resultKey: String): PopResult?

Awaits the result tagged with resultKey for recordKey, or returns null for a stale key.

Link copied to clipboard
fun expectingResult(recordKey: String): Boolean

Returns whether recordKey is expecting a result.

Link copied to clipboard
fun forEachExpectedResult(block: (recordKey: String, resultKey: String, pendingResult: PopResult?) -> Unit)

Visits each expected result without consuming its pending result.

Link copied to clipboard
fun prepareForResult(recordKey: String, resultKey: String)

Prepares recordKey to receive a result tagged with resultKey.

Link copied to clipboard
fun sendResult(recordKey: String, result: PopResult)

Sends result to recordKey.