mirror of
https://github.com/modo-studio/SugarRecord.git
synced 2024-09-11 14:36:41 +03:00
Add -observable to CoreData storages
This commit is contained in:
parent
ba1de75714
commit
9a40d5394c
@ -87,6 +87,13 @@ public class CoreDataDefaultStorage: Storage {
|
||||
self.mainContext = cdContext(withParent: .Context(self.rootSavingContext), concurrencyType: .MainQueueConcurrencyType, inMemory: false)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
public func observable<T: NSManagedObject>(request: Request<T>) -> Observable<T> {
|
||||
return CoreDataObservable(request: request, context: self.mainContext as! NSManagedObjectContext)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -78,7 +78,7 @@ public class CoreDataiCloudStorage: Storage {
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Constructors
|
||||
// MARK: - Init
|
||||
|
||||
public init(model: CoreData.ObjectModel, iCloud: ICloudConfig) throws {
|
||||
self.objectModel = model.model()!
|
||||
@ -90,6 +90,13 @@ public class CoreDataiCloudStorage: Storage {
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
public func observable<T: NSManagedObject>(request: Request<T>) -> Observable<T> {
|
||||
return CoreDataObservable(request: request, context: self.mainContext as! NSManagedObjectContext)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func observeiCloudChangesInCoordinator() {
|
||||
|
Loading…
Reference in New Issue
Block a user