DittoSyncSubscription

public class DittoSyncSubscription
extension DittoSyncSubscription: Hashable
extension DittoSyncSubscription: Equatable

A sync subscription configures Ditto to receive updates from remote peers about documents matching the subscription’s query.

Create a sync subscription by calling DittoSync.registerSubscription(). The subscription will remain active until either explicitly cancelled via DittoSyncSubscription.cancel() or the owning Ditto object goes out of scope.

  • The Ditto object this sync subscription belongs to.

    Declaration

    Swift

    public private(set) weak var ditto: Ditto? { get }
  • The query string of the sync subscription (as passed while registering it).

    Declaration

    Swift

    public let queryString: String
  • The query arguments of the sync subscription (as passed while registering it).

    Declaration

    Swift

    public let queryArguments: [String : Any?]?
  • Convenience property, returns true if the sync subscription has been cancelled, otherwise returns false. Also, a sync subscription is considered cancelled if the owning Ditto object goes out of scope.

    Declaration

    Swift

    public var isCancelled: Bool { get }
  • Cancels the sync subscription so that new changes matching the query are no longer received from other peers. No-op if it’s already cancelled via or the owning Ditto object goes out of scope.

    Declaration

    Swift

    public func cancel()

Hashable

  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)

Equatable

  • Declaration

    Swift

    public static func == (left: DittoSyncSubscription, right: DittoSyncSubscription) -> Bool