Observing Changes

  • Used to subscribe to receive updates from remote peers about matching documents.

    While DittoSubscription 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.

    See more

    Declaration

    Swift

    public class DittoSubscription
  • The type that is returned when calling when calling observeLocal on a DittoPendingCursorOperation object. It handles the logic for calling the event handler that is provided to observeLocal 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.

    See more

    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 update case of the DittoLiveQueryEvent enum.

    See more

    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.
    See more

    Declaration

    Swift

    public enum DittoLiveQueryEvent
    extension DittoLiveQueryEvent: CustomStringConvertible, CustomDebugStringConvertible
  • Provides information about a live query event relating to a single document live query.

    See more

    Declaration

    Swift

    public struct DittoSingleDocumentLiveQueryEvent