Skip to content

Commit 8a8583a

Browse files
committed
Update ManagedObjectViewContext
1 parent 2873125 commit 8a8583a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/CoreDataModel/NSManagedObjectContext.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,16 @@ public final class ManagedObjectViewContext: ViewContext, ObservableObject {
7676

7777
public init(context: NSManagedObjectContext) {
7878
self.context = context
79+
context.automaticallyMergesChangesFromParent = true
80+
context.stalenessInterval = 0
7981
assert(context.concurrencyType == .mainQueueConcurrencyType)
8082
setupNotificationObservers()
8183
}
8284

8385
public init(persistentContainer: NSPersistentContainer) {
8486
self.context = persistentContainer.viewContext
87+
context.automaticallyMergesChangesFromParent = true
88+
context.stalenessInterval = 0
8589
assert(context.concurrencyType == .mainQueueConcurrencyType)
8690
setupNotificationObservers()
8791
}

0 commit comments

Comments
 (0)