@@ -11,7 +11,6 @@ public typealias ValueSubject<Value> = CurrentValueSubject<Value, Never>
1111/// This is a common output type for observing storage value changes.
1212public typealias ValuePublisher < Value> = AnyPublisher < Value , Never >
1313
14- #if swift(>=6.0)
1514/// A protocol that defines a reactive storage interface for reading and writing values.
1615///
1716/// `Storage` abstracts the concept of value persistence with support for Combine-based observation.
@@ -38,27 +37,6 @@ public protocol Storage<Value>: AnyObject, Sendable, ObservableObject {
3837 /// - Returns: An `AnyCancellable` that can be used to cancel the subscription.
3938 func sink( receiveValue: @escaping @Sendable ( Value ) -> Void ) -> AnyCancellable
4039}
41- #else
42- /// A protocol that defines the interface for storing and retrieving values.
43- /// Storage implementations provide a way to persist and observe changes to values.
44- ///
45- /// The protocol combines Combine's `ObservableObject` with a value storage mechanism,
46- /// allowing for reactive updates when values change.
47- public protocol Storage < Value> : AnyObject , ObservableObject {
48- associatedtype Value
49-
50- /// A publisher that emits the current value and any subsequent changes.
51- var eventier : ValuePublisher < Value > { get }
52-
53- /// The current value stored in the storage.
54- var value : Value { get set }
55-
56- /// Subscribes to value changes and returns a cancellable subscription.
57- /// - Parameter receiveValue: A closure that is called with the new value whenever it changes.
58- /// - Returns: A cancellable subscription that can be used to stop receiving updates.
59- func sink( receiveValue: @escaping ( Value ) -> Void ) -> AnyCancellable
60- }
61- #endif
6240
6341public extension Storage {
6442 /// Default implementation of `sink(receiveValue:)` that forwards to the `eventier` publisher.
0 commit comments