Observing Changes
-
A replication subscription configures Ditto to receive updates from remote peers about documents matching the subscription’s query.
See moreDeclaration
Swift
public class DittoReplicationSubscription
extension DittoReplicationSubscription: Hashable
extension DittoReplicationSubscription: Equatable
-
Used to subscribe to receive updates from remote peers about matching documents.
While
See moreDittoSubscription
objects remain in scope they ensure that documents in the collection specified and that match the query provided will try to be kept up-to-date with the latest changes from remote peers.Declaration
Swift
public class DittoSubscription
-
The type that is returned when calling when calling
See moreobserveLocal
on aDittoPendingCursorOperation
object. It handles the logic for calling the event handler that is provided toobserveLocal
calls.DittoLiveQuery
objects must be kept in scope for as long as you wish to have your event handler be called when there is an update to a document matching the query you provide.Declaration
Swift
public class DittoLiveQuery
-
Provides information about the changes that have occurred in relation to a live query for a given update event.
This type is returned in the
See moreupdate
case of theDittoLiveQueryEvent
enum.Declaration
Swift
public struct DittoLiveQueryUpdate
-
Describes the different types of event that you can receive when dealing with live queries.
- initial: The first event that will be delivered and it will only be delivered once.
- update: This event will be delivered each time the results of the provided query change. It contains information about the set of documents that previously matched the query before the update, along with information about what documents have been inserted, deleted, updated, or moved, as part of the set of matching documents.
Declaration
Swift
public enum DittoLiveQueryEvent
extension DittoLiveQueryEvent: CustomStringConvertible, CustomDebugStringConvertible
-
Provides information about a live query event relating to a single document live query.
See moreDeclaration
Swift
public struct DittoSingleDocumentLiveQueryEvent