From ddf599ba859a216e83294f02df26a25ea7955f11 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Fri, 18 Oct 2019 08:19:55 +0900 Subject: [PATCH] WIP: documentation --- CoreStore.xcodeproj/project.pbxproj | 30 +-- Sources/CoreStore+Observing.swift | 4 +- Sources/DataStack+DataSources.swift | 11 ++ Sources/DataStack+Observing.swift | 4 +- ...ft => EnvironmentValues+DataSources.swift} | 44 +++-- Sources/LiveList.swift | 31 ++++ Sources/LiveQuery.swift | 173 ------------------ Sources/UnsafeDataTransaction+Observing.swift | 4 +- 8 files changed, 85 insertions(+), 216 deletions(-) rename Sources/{EnvironmentKeys.swift => EnvironmentValues+DataSources.swift} (70%) delete mode 100644 Sources/LiveQuery.swift diff --git a/CoreStore.xcodeproj/project.pbxproj b/CoreStore.xcodeproj/project.pbxproj index 8476d39..96cc302 100644 --- a/CoreStore.xcodeproj/project.pbxproj +++ b/CoreStore.xcodeproj/project.pbxproj @@ -408,10 +408,10 @@ B55BB4D5235012AE00C33E34 /* ObjectRepresentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B55BB4D3235012AE00C33E34 /* ObjectRepresentation.swift */; }; B55BB4D6235012AE00C33E34 /* ObjectRepresentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B55BB4D3235012AE00C33E34 /* ObjectRepresentation.swift */; }; B55BB4D7235012AE00C33E34 /* ObjectRepresentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B55BB4D3235012AE00C33E34 /* ObjectRepresentation.swift */; }; - B55BB4D823503B9500C33E34 /* EnvironmentKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F849702348A6690029D57B /* EnvironmentKeys.swift */; }; - B55BB4D923503B9600C33E34 /* EnvironmentKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F849702348A6690029D57B /* EnvironmentKeys.swift */; }; - B55BB4DA23503B9600C33E34 /* EnvironmentKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F849702348A6690029D57B /* EnvironmentKeys.swift */; }; - B55BB4DB23503B9700C33E34 /* EnvironmentKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F849702348A6690029D57B /* EnvironmentKeys.swift */; }; + B55BB4D823503B9500C33E34 /* EnvironmentValues+DataSources.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F849702348A6690029D57B /* EnvironmentValues+DataSources.swift */; }; + B55BB4D923503B9600C33E34 /* EnvironmentValues+DataSources.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F849702348A6690029D57B /* EnvironmentValues+DataSources.swift */; }; + B55BB4DA23503B9600C33E34 /* EnvironmentValues+DataSources.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F849702348A6690029D57B /* EnvironmentValues+DataSources.swift */; }; + B55BB4DB23503B9700C33E34 /* EnvironmentValues+DataSources.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F849702348A6690029D57B /* EnvironmentValues+DataSources.swift */; }; B56007111B3F6BD500A9A8F9 /* Into.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56007101B3F6BD500A9A8F9 /* Into.swift */; }; B56007141B3F6C2800A9A8F9 /* SectionBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56007131B3F6C2800A9A8F9 /* SectionBy.swift */; }; B56007161B4018AB00A9A8F9 /* MigrationChain.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56007151B4018AB00A9A8F9 /* MigrationChain.swift */; }; @@ -822,10 +822,6 @@ B5F335592348D76300FD649F /* LiveResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F335572348D75D00FD649F /* LiveResult.swift */; }; B5F3355A2348D76500FD649F /* LiveResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F335572348D75D00FD649F /* LiveResult.swift */; }; B5F3355B2348D76500FD649F /* LiveResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F335572348D75D00FD649F /* LiveResult.swift */; }; - B5F3355C2348D93700FD649F /* LiveQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F84966234887EB0029D57B /* LiveQuery.swift */; }; - B5F3355D2348D93800FD649F /* LiveQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F84966234887EB0029D57B /* LiveQuery.swift */; }; - B5F3355E2348D93900FD649F /* LiveQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F84966234887EB0029D57B /* LiveQuery.swift */; }; - B5F3355F2348D93900FD649F /* LiveQuery.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F84966234887EB0029D57B /* LiveQuery.swift */; }; B5F8496C234898240029D57B /* ListSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F8496B234898240029D57B /* ListSnapshot.swift */; }; B5F8496D234898240029D57B /* ListSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F8496B234898240029D57B /* ListSnapshot.swift */; }; B5F8496E234898240029D57B /* ListSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F8496B234898240029D57B /* ListSnapshot.swift */; }; @@ -1120,9 +1116,8 @@ B5F1DA8C1B9AA97D007C5CBB /* ImportableObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImportableObject.swift; sourceTree = ""; }; B5F1DA8F1B9AA991007C5CBB /* ImportableUniqueObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImportableUniqueObject.swift; sourceTree = ""; }; B5F335572348D75D00FD649F /* LiveResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveResult.swift; sourceTree = ""; }; - B5F84966234887EB0029D57B /* LiveQuery.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveQuery.swift; sourceTree = ""; }; B5F8496B234898240029D57B /* ListSnapshot.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListSnapshot.swift; sourceTree = ""; }; - B5F849702348A6690029D57B /* EnvironmentKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnvironmentKeys.swift; sourceTree = ""; }; + B5F849702348A6690029D57B /* EnvironmentValues+DataSources.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "EnvironmentValues+DataSources.swift"; sourceTree = ""; }; B5FAD6A81B50A4B300714891 /* Progress+Convenience.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Progress+Convenience.swift"; sourceTree = ""; }; B5FAD6AB1B51285300714891 /* Internals.MigrationManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Internals.MigrationManager.swift; sourceTree = ""; }; B5FAD6AD1B518DCB00714891 /* CoreStore+Migration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "CoreStore+Migration.swift"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; @@ -1601,8 +1596,7 @@ B5E5FA4C22D15D3C00330931 /* DataSources */ = { isa = PBXGroup; children = ( - B5F849702348A6690029D57B /* EnvironmentKeys.swift */, - B5F84966234887EB0029D57B /* LiveQuery.swift */, + B5F849702348A6690029D57B /* EnvironmentValues+DataSources.swift */, B50132292344ECB500FC238B /* LiveList.swift */, B5BF7FC0234D7B2E0070E741 /* LiveObject.swift */, B5F8496B234898240029D57B /* ListSnapshot.swift */, @@ -2095,7 +2089,7 @@ buildActionMask = 2147483647; files = ( B5DE5230230BDA1300A22534 /* Shared.swift in Sources */, - B55BB4DB23503B9700C33E34 /* EnvironmentKeys.swift in Sources */, + B55BB4DB23503B9700C33E34 /* EnvironmentValues+DataSources.swift in Sources */, B5E84F221AFF84860064E85B /* ObjectMonitor.swift in Sources */, B5ECDBF91CA804FD00C7F112 /* NSManagedObjectContext+ObjectiveC.swift in Sources */, B5CA2B081F7E5ACA004B1936 /* WhereClauseType.swift in Sources */, @@ -2276,7 +2270,6 @@ B5E84F151AFF847B0064E85B /* CoreStore+Querying.swift in Sources */, B5E84F241AFF84860064E85B /* ListObserver.swift in Sources */, B501322A2344ECB500FC238B /* LiveList.swift in Sources */, - B5F3355C2348D93700FD649F /* LiveQuery.swift in Sources */, B5F8496C234898240029D57B /* ListSnapshot.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2374,7 +2367,7 @@ B509C7F51E54511B0061C547 /* ImportableAttributeType.swift in Sources */, 82BA18B31C4BBD3900A0916E /* ImportableUniqueObject.swift in Sources */, B50EE14323473C96009B8C47 /* CoreStoreObject+DataSources.swift in Sources */, - B55BB4DA23503B9600C33E34 /* EnvironmentKeys.swift in Sources */, + B55BB4DA23503B9600C33E34 /* EnvironmentValues+DataSources.swift in Sources */, B5E1B5951CAA0C15007FD580 /* CSObjectMonitor.swift in Sources */, 18166887232B9ED60097C275 /* String+KeyPaths.swift in Sources */, B5ECDC2B1CA81CC700C7F112 /* CSDataStack+Transaction.swift in Sources */, @@ -2409,7 +2402,6 @@ B5E41EC11EA9BB37006240F0 /* DynamicSchema+Convenience.swift in Sources */, B501FDE41CA8D1F500BE22EF /* CSListMonitor.swift in Sources */, B5A1DAC91F111BFA003CF369 /* KeyPath+Querying.swift in Sources */, - B5F3355D2348D93800FD649F /* LiveQuery.swift in Sources */, B5FE4DA31C8481E100FA6A91 /* StorageInterface.swift in Sources */, B5ECDC131CA816E500C7F112 /* CSTweak.swift in Sources */, B56923C51EB823B4007C4DC9 /* NSEntityDescription+Migration.swift in Sources */, @@ -2599,7 +2591,7 @@ B509C7F71E54511B0061C547 /* ImportableAttributeType.swift in Sources */, B5220E1F1D130810009BC71E /* CSListObserver.swift in Sources */, B50EE14523473C97009B8C47 /* CoreStoreObject+DataSources.swift in Sources */, - B55BB4D823503B9500C33E34 /* EnvironmentKeys.swift in Sources */, + B55BB4D823503B9500C33E34 /* EnvironmentValues+DataSources.swift in Sources */, B52DD1941BE1F92500949AFE /* CoreStore.swift in Sources */, 18166889232B9ED80097C275 /* String+KeyPaths.swift in Sources */, B52DD1A61BE1F92F00949AFE /* BaseDataTransaction+Importing.swift in Sources */, @@ -2634,7 +2626,6 @@ B5220E131D1305ED009BC71E /* SectionBy.swift in Sources */, B559CD4D1CAA8C6D00E4D58B /* CSStorageInterface.swift in Sources */, B5E41EC31EA9BB37006240F0 /* DynamicSchema+Convenience.swift in Sources */, - B5F3355F2348D93900FD649F /* LiveQuery.swift in Sources */, B5ECDBE91CA6BEA300C7F112 /* CSClauseTypes.swift in Sources */, B5A1DACB1F111BFA003CF369 /* KeyPath+Querying.swift in Sources */, B52DD1B81BE1F94000949AFE /* DataStack+Migration.swift in Sources */, @@ -2824,7 +2815,7 @@ B509C7F61E54511B0061C547 /* ImportableAttributeType.swift in Sources */, B5E1B5961CAA0C15007FD580 /* CSObjectMonitor.swift in Sources */, B50EE14423473C97009B8C47 /* CoreStoreObject+DataSources.swift in Sources */, - B55BB4D923503B9600C33E34 /* EnvironmentKeys.swift in Sources */, + B55BB4D923503B9600C33E34 /* EnvironmentValues+DataSources.swift in Sources */, B5ECDC2C1CA81CC700C7F112 /* CSDataStack+Transaction.swift in Sources */, 18166888232B9ED70097C275 /* String+KeyPaths.swift in Sources */, B56321911BD65216006C9394 /* BaseDataTransaction+Importing.swift in Sources */, @@ -2859,7 +2850,6 @@ B501FDEA1CA8D20500BE22EF /* CSListObserver.swift in Sources */, B501FDE51CA8D1F500BE22EF /* CSListMonitor.swift in Sources */, B5E41EC21EA9BB37006240F0 /* DynamicSchema+Convenience.swift in Sources */, - B5F3355E2348D93900FD649F /* LiveQuery.swift in Sources */, B5ECDC141CA816E500C7F112 /* CSTweak.swift in Sources */, B5A1DACA1F111BFA003CF369 /* KeyPath+Querying.swift in Sources */, B56321AE1BD6521C006C9394 /* Internals.NotificationObserver.swift in Sources */, diff --git a/Sources/CoreStore+Observing.swift b/Sources/CoreStore+Observing.swift index 8de1b06..02bfa1e 100644 --- a/Sources/CoreStore+Observing.swift +++ b/Sources/CoreStore+Observing.swift @@ -34,9 +34,9 @@ import CoreData extension CoreStore { /** - Using the `defaultStack`, creates an `ObjectMonitor` for the specified `ObjectRepresentation`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`. + Using the `defaultStack`, creates an `ObjectMonitor` for the specified `DynamicObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`. - - parameter object: the `ObjectRepresentation` to observe changes from + - parameter object: the `DynamicObject` to observe changes from - returns: a `ObjectMonitor` that monitors changes to `object` */ public static func monitorObject(_ object: O) -> ObjectMonitor { diff --git a/Sources/DataStack+DataSources.swift b/Sources/DataStack+DataSources.swift index 2f1895f..827bfc7 100644 --- a/Sources/DataStack+DataSources.swift +++ b/Sources/DataStack+DataSources.swift @@ -32,6 +32,17 @@ import CoreData // MARK: - DataStack extension DataStack { + + /** + Creates a `LiveObject` for the specified `DynamicObject`. Multiple objects may then register themselves to be notified when changes are made to the `DynamicObject`. + + - parameter object: the `DynamicObject` to observe changes from + - returns: a `LiveObject` that broadcasts changes to `object` + */ + public func liveObject(_ object: O) -> LiveObject { + + return LiveObject(objectID: object.cs_id(), context: self.unsafeContext()) + } public func liveList(_ from: From, _ fetchClauses: FetchClause...) -> LiveList { diff --git a/Sources/DataStack+Observing.swift b/Sources/DataStack+Observing.swift index 3eb7e70..f111ee0 100644 --- a/Sources/DataStack+Observing.swift +++ b/Sources/DataStack+Observing.swift @@ -33,9 +33,9 @@ import CoreData extension DataStack { /** - Creates an `ObjectMonitor` for the specified `ObjectRepresentation`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`. + Creates an `ObjectMonitor` for the specified `DynamicObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`. - - parameter object: the `ObjectRepresentation` to observe changes from + - parameter object: the `DynamicObject` to observe changes from - returns: a `ObjectMonitor` that monitors changes to `object` */ public func monitorObject(_ object: O) -> ObjectMonitor { diff --git a/Sources/EnvironmentKeys.swift b/Sources/EnvironmentValues+DataSources.swift similarity index 70% rename from Sources/EnvironmentKeys.swift rename to Sources/EnvironmentValues+DataSources.swift index 882e012..ebc55a2 100644 --- a/Sources/EnvironmentKeys.swift +++ b/Sources/EnvironmentValues+DataSources.swift @@ -1,5 +1,5 @@ // -// EnvironmentKeys.swift +// EnvironmentValues+DataSources.swift // CoreStore // // Copyright © 2018 John Rommel Estropia @@ -28,20 +28,6 @@ import SwiftUI -// MARK: - DataStackEnvironmentKey - -@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *) -public struct DataStackEnvironmentKey: EnvironmentKey { - - // MARK: Public - - public static var defaultValue: DataStack { - - return Shared.defaultStack - } -} - - // MARK: - EnvironmentValues @available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *) @@ -49,12 +35,36 @@ extension EnvironmentValues { // MARK: Public + /** + The `DataStack` instance injected to `self`: + ``` + @Environment(\.dataStack) + var dataStack: DataStack + ``` + */ public var dataStack: DataStack { + get { - return self[DataStackEnvironmentKey.self] + + return self[DataStackKey.self] } set { - self[DataStackEnvironmentKey.self] = newValue + + self[DataStackKey.self] = newValue + } + } + + + // MARK: - DataStackEnvironmentKey + + @available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *) + fileprivate struct DataStackKey: EnvironmentKey { + + // MARK: FilePrivate + + fileprivate static var defaultValue: DataStack { + + return Shared.defaultStack } } } diff --git a/Sources/LiveList.swift b/Sources/LiveList.swift index fdce498..7b937aa 100644 --- a/Sources/LiveList.swift +++ b/Sources/LiveList.swift @@ -38,6 +38,37 @@ import SwiftUI // MARK: - LiveList +/** + `LiveList` tracks a diffable list of `DynamicObject` instances. Unlike `ListMonitor`s, `LiveList` are more lightweight and access objects lazily. `LiveList`s are also designed to work well with `DiffableDataSource.TableView`s and `DiffableDataSource.CollectionView`s. Objects that need to be notified of `LiveList` changes may register themselves to its `addObserver(_:_:)` method: + ``` + let liveList = Shared.defaultStack.liveList( + From() + .where(\.title == "Engineer") + .orderBy(.ascending(\.lastName)) + ) + liveList.addObserver(self) { (liveList) in + + // Handle changes + } + ``` + The `LiveList` instance needs to be held on (retained) for as long as the list needs to be observed. + Observers registered via `addObserver(_:_:)` are not retained. `LiveList` only keeps a `weak` reference to all observers, thus keeping itself free from retain-cycles. + + `LiveList`s may optionally be created with sections: + ``` + let liveList = Shared.defaultStack.liveList( + From() + .sectionBy(\.age") { "Age \($0)" } + .where(\.title == "Engineer") + .orderBy(.ascending(\.lastName)) + ) + liveList.addObserver(self) { (liveList) in + + // Handle changes + } + ``` + */ +@available(macOS 10.12, *) public final class LiveList: Hashable { // MARK: Public diff --git a/Sources/LiveQuery.swift b/Sources/LiveQuery.swift deleted file mode 100644 index aefa1ce..0000000 --- a/Sources/LiveQuery.swift +++ /dev/null @@ -1,173 +0,0 @@ -// -// LiveQuery.swift -// CoreStore -// -// Copyright © 2018 John Rommel Estropia -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -//#if canImport(SwiftUI) && canImport(Combine) -// -//import CoreData -//import Combine -//import SwiftUI -// -// -//#warning("TODO: autoupdating doesn't work yet") -//@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *) -//@propertyWrapper -//public struct LiveQuery: DynamicProperty { -// -// // MARK: Public -// -// @Environment(\.dataStack) -// public var dataStack: DataStack -// -// public typealias ObjectType = Result.ObjectType -// -// -// // MARK: @propertyWrapper -// -// public var wrappedValue: Result { -// -// get { -// -// return self.backingWrapper!.wrappedValue -// } -// set { -// -// self.backingWrapper!.wrappedValue = newValue -// } -// } -// -// public var projectedValue: ObservedObject.Wrapper { -// -// return self.backingWrapper!.projectedValue -// } -// -// -// // MARK: DynamicProperty -// -// public mutating func update() { -// -// SwiftUI.withAnimation { -// -// let dataStack = self.dataStack -// -// if self.backingWrapper == nil { -// -// self.backingWrapper = ObservedObject(wrappedValue: self.newLiveResult(dataStack)) -// } -// else { -// -// self.backingWrapper!.wrappedValue = self.newLiveResult(dataStack) -// } -// self.backingWrapper!.update() -// } -// } -// -// -// // MARK: FilePrivate -// -// fileprivate let newLiveResult: (DataStack) -> Result -// -// fileprivate init(newLiveResult: @escaping (DataStack) -> Result) { -// -// self.newLiveResult = newLiveResult -// } -// -// -// // MARK: Private -// -//// private var nonMutatingWrappedValue: LazyNonmutating = .init { fatalError() } -// -// private var currentDataStack: DataStack? -// private var backingWrapper: ObservedObject? -// -// private mutating func set(dataStack: DataStack) -> Bool { -// -// guard self.currentDataStack != dataStack else { -// -// return false -// } -// self.currentDataStack = dataStack -// if self.backingWrapper == nil { -// -// self.backingWrapper = ObservedObject(wrappedValue: self.newLiveResult(dataStack)) -// } -// else { -// -// self.backingWrapper?.wrappedValue = self.newLiveResult(dataStack) -// } -// return true -// } -// -// -// // MARK: - LazyNonmutating -// -// fileprivate final class LazyNonmutating { -// -// // MARK: FilePrivate -// -// lazy var wrappedValue: Value = self.initializer() -// -// init(_ initializer: @escaping () -> Value) { -// -// self.initializer = initializer -// } -// -// -// // MARK: Private -// -// private var initializer: () -> Value -// } -//} -// -// -//#if canImport(UIKit) || canImport(AppKit) -// -//@available(iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15, *) -//extension LiveQuery { -// -// public init(liveList: LiveList) where Result == LiveList { -// -// self.init( -// newLiveResult: { _ in liveList } -// ) -// } -// -// public init(_ clauseChain: FetchChainBuilder) where Result == LiveList { -// -// self.init( -// newLiveResult: { $0.liveList(clauseChain) } -// ) -// } -// -// public init(_ clauseChain: SectionMonitorChainBuilder) where Result == LiveList { -// -// self.init( -// newLiveResult: { $0.liveList(clauseChain) } -// ) -// } -//} -// -//#endif -// -//#endif diff --git a/Sources/UnsafeDataTransaction+Observing.swift b/Sources/UnsafeDataTransaction+Observing.swift index be8574d..ad12bb8 100644 --- a/Sources/UnsafeDataTransaction+Observing.swift +++ b/Sources/UnsafeDataTransaction+Observing.swift @@ -33,9 +33,9 @@ import CoreData extension UnsafeDataTransaction { /** - Creates a `ObjectMonitor` for the specified `ObjectRepresentation`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`. + Creates an `ObjectMonitor` for the specified `DynamicObject`. Multiple `ObjectObserver`s may then register themselves to be notified when changes are made to the `DynamicObject`. - - parameter object: the `ObjectRepresentation` to observe changes from + - parameter object: the `DynamicObject` to observe changes from - returns: a `ObjectMonitor` that monitors changes to `object` */ public func monitorObject(_ object: O) -> ObjectMonitor {