1- import Foundation
21import Dispatch
2+ import Foundation
33
44/// A protocol representing the read-only interface of an `AsyncObservable`.
55/// This allows for providing read-only access to an observable state without
66/// exposing methods that can modify the state.
77@available ( iOS 17 . 0 , macOS 14 . 0 , tvOS 17 . 0 , watchOS 10 . 0 , * )
88public protocol AsyncObservableReadOnly < T> : Sendable {
9- /// The type of value being observed.
10- associatedtype T : Sendable
9+ /// The type of value being observed.
10+ associatedtype T : Sendable
11+
12+ /// The current value accessible from the MainActor.
13+ /// This is a convenience property that provides direct access to the observable value.
14+ @MainActor
15+ var observable : T { get }
1116
12- /// The current value accessible from the MainActor.
13- /// This is a convenience property that provides direct access to the observable value.
14- @MainActor
15- var observable : T { get }
17+ /// An async stream of values that can be used with Swift concurrency.
18+ /// This property provides a convenient way to access the value stream.
19+ var stream : StreamOf < T > { get }
1620
17- /// An async stream of values that can be used with Swift concurrency.
18- /// This property provides a convenient way to access the value stream.
19- var stream : StreamOf < T > { get }
21+ /// The current value managed by this instance.
22+ var raw : T { get }
2023
21- /// The current value managed by this instance.
22- var raw : T { get }
23- }
24+ @ available ( iOS 17 . 0 , macOS 15 . 0 , tvOS 17 . 0 , watchOS 10 . 0 , * )
25+ func unwrappedStream < U > ( ) -> any AsyncSequence < U , Never > where T == U ?
26+ }
0 commit comments