mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-21 17:09:10 +01:00
Revert ObjectMonitor to previous implementation
This commit is contained in:
@@ -88,10 +88,15 @@ public final class LiveObject<O: DynamicObject>: ObjectRepresentation, Hashable
|
||||
}
|
||||
return Self.init(objectID: self.id, context: context)
|
||||
}
|
||||
|
||||
public func asReadOnly(in dataStack: DataStack) -> O? {
|
||||
|
||||
return dataStack.unsafeContext().fetchExisting(self.id)
|
||||
}
|
||||
|
||||
public func asEditable(in transaction: BaseDataTransaction) -> O? {
|
||||
|
||||
return self.context.fetchExisting(self.id)
|
||||
return transaction.unsafeContext().fetchExisting(self.id)
|
||||
}
|
||||
|
||||
public func asSnapshot(in dataStack: DataStack) -> ObjectSnapshot<O>? {
|
||||
@@ -113,11 +118,6 @@ public final class LiveObject<O: DynamicObject>: ObjectRepresentation, Hashable
|
||||
}
|
||||
return .init(objectID: self.id, context: context)
|
||||
}
|
||||
|
||||
public func asObjectMonitor(in dataStack: DataStack) -> ObjectMonitor<O>? {
|
||||
|
||||
return .init(objectID: self.id, context: dataStack.unsafeContext())
|
||||
}
|
||||
|
||||
|
||||
// MARK: Equatable
|
||||
@@ -354,12 +354,4 @@ extension LiveObject where O: CoreStoreObject {
|
||||
|
||||
return self.snapshot[dynamicMember: member]
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the value for the property identified by a given key.
|
||||
*/
|
||||
public subscript<T>(dynamicMember member: KeyPath<O, T>) -> T {
|
||||
|
||||
return self.object[keyPath: member]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user