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

The sync subscription will remain active until it is cancelled, or the Ditto instance managing the subscription has been closed.

Create a sync subscription by calling ditto.sync.registerSubscription().

Type Parameters

Properties

ditto: Ditto

The Ditto instance this sync subscription belongs to.

queryArguments?: Readonly<T>

The query arguments of the sync subscription (as passed when adding it to the store).

queryString: string

Documents matching this query will be included in the sync subscription.

Accessors

  • get isCancelled(): boolean
  • true when the sync subscription has been cancelled or the Ditto instance managing this subscription has been closed.

    Returns boolean

Methods

  • Cancels the sync subscription and unregisters it. No-op if the sync subscription has already been cancelled or the Ditto instance managing this subscription has been closed.

    Returns void