Skip to content

Commit cca3380

Browse files
committed
make unwrappedStream public
1 parent a200a47 commit cca3380

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to AsyncObservable will be documented in this file.
44

5+
## [0.3.2] - 2025-03-08
6+
7+
### Fixed
8+
- made unwrappedStream public
9+
510
## [0.3.1] - 2025-03-08
611

712
### Added

Sources/AsyncObservable/AsyncObservable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ open class AsyncObservable<T: Sendable>: AsyncObservableReadOnly, @unchecked Sen
252252
}
253253

254254
@available(iOS 17.0, macOS 15.0, tvOS 17.0, watchOS 10.0, *)
255-
func unwrappedStream<U>() -> any AsyncSequence<U, Never> where T == U? {
255+
public func unwrappedStream<U>() -> any AsyncSequence<U, Never> where T == U? {
256256
stream.compactMap { $0 }
257257
}
258258

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
import Foundation
21
import 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, *)
88
public 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

Comments
 (0)