Contents

untilFinished(_:)

Constructs an asynchronous sequence for a given closure by tracking changes of @Observable types.

Declaration

static func untilFinished(_ emit: @escaping @isolated(any) @Sendable () throws(Failure) -> Observations<Element, Failure>.Iteration) -> Observations<Element, Failure>

Parameters

  • emit:

    A closure to generate an element for the sequence.

Discussion

The emit closure is responsible for extracting a value out of a single or many @Observable types. This method continues to be invoked until the .finished option is returned or an error is thrown.