Standardize list and object observer api #254

Closed
opened 2025-12-29 15:27:40 +01:00 by adam · 1 comment
Owner

Originally created by @iby on GitHub (Jan 15, 2019).

Would be neat to match method signature style of:

protocol ObjectObserver {
    func objectMonitor(_ monitor: CoreStore.ObjectMonitor<Self.ObjectEntityType>, willUpdateObject object: Self.ObjectEntityType)
    func objectMonitor(_ monitor: CoreStore.ObjectMonitor<Self.ObjectEntityType>, didUpdateObject object: Self.ObjectEntityType, changedPersistentKeys: Set<KeyPathString>)
    func objectMonitor(_ monitor: CoreStore.ObjectMonitor<Self.ObjectEntityType>, didDeleteObject object: Self.ObjectEntityType)
}

with:

protocol ListObserver {
    func listMonitorWillChange(_ monitor: CoreStore.ListMonitor<Self.ListEntityType>)
    func listMonitorDidChange(_ monitor: CoreStore.ListMonitor<Self.ListEntityType>)
    func listMonitorWillRefetch(_ monitor: CoreStore.ListMonitor<Self.ListEntityType>)
    func listMonitorDidRefetch(_ monitor: CoreStore.ListMonitor<Self.ListEntityType>)
}
Originally created by @iby on GitHub (Jan 15, 2019). Would be neat to match method signature style of: ```swift protocol ObjectObserver { func objectMonitor(_ monitor: CoreStore.ObjectMonitor<Self.ObjectEntityType>, willUpdateObject object: Self.ObjectEntityType) func objectMonitor(_ monitor: CoreStore.ObjectMonitor<Self.ObjectEntityType>, didUpdateObject object: Self.ObjectEntityType, changedPersistentKeys: Set<KeyPathString>) func objectMonitor(_ monitor: CoreStore.ObjectMonitor<Self.ObjectEntityType>, didDeleteObject object: Self.ObjectEntityType) } ``` with: ```swift protocol ListObserver { func listMonitorWillChange(_ monitor: CoreStore.ListMonitor<Self.ListEntityType>) func listMonitorDidChange(_ monitor: CoreStore.ListMonitor<Self.ListEntityType>) func listMonitorWillRefetch(_ monitor: CoreStore.ListMonitor<Self.ListEntityType>) func listMonitorDidRefetch(_ monitor: CoreStore.ListMonitor<Self.ListEntityType>) } ```
adam closed this issue 2025-12-29 15:27:41 +01:00
Author
Owner

@iby commented on GitHub (Jan 15, 2019):

Sorry, just realized it doesn't make any sense… 🤦‍♂️ Please delete.

@iby commented on GitHub (Jan 15, 2019): Sorry, just realized it doesn't make any sense… 🤦‍♂️ Please delete.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#254