<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Observation",
  "identifier" : "/documentation/Observation/Observations/untilFinished(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Observation"
    ],
    "preciseIdentifier" : "s:11Observation12ObservationsV13untilFinishedyACyxq_GAC9IterationOyxq__GyYbq_YKYAcFZ"
  },
  "title" : "untilFinished(_:)"
}
-->

# untilFinished(_:)

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

```
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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)