Avatar
omochimetaru 4/12/2023 1:22 AM
public struct ObservedChange<Subject: Observable>: @unchecked Sendable { public func contains(_ member: PartialKeyPath<Subject>) -> Bool } extension ObservedChange where Subject: Sendable { public var subject: Subject { get } } /// An asynchronous sequence of observed changes. public struct ObservedChanges<Subject: Observable, Delivery: Actor>: AsyncSequence { public typealias Element = ObservedChange<Subject> public struct Iterator: AsyncIteratorProtocol { public mutating func next() async -> Element? } public func makeAsyncIterator() -> Iterator } extension ObservedChanges: @unchecked Sendable where Subject: Sendable { } @available(*, unavailable) extension ObservedChanges.Iterator: Sendable { }
1:23 AM
ObservedChangesは、Observable自身が subject から取り出せて、「何が変わったか」が contains(PartialKeyPath) で調べられる?