Ditto JS SDK v5.0.0
    Preparing search index...

    Class SyncSubscription

    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().

    Index

    Properties

    ditto: Ditto

    The Ditto instance this sync subscription belongs to.

    Accessors

    • get isCancelled(): boolean

      true when the sync subscription has been cancelled or the Ditto instance managing this subscription has been closed.

      Returns boolean

    • get queryArguments(): Readonly<any>

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

      Note that this value is not guaranteed to be strictly equal to the value used when registering the sync subscription. In particular, any Attachment values in query arguments will be represented by that attachment's attachment token here.

      Also see queryArgumentsCBORData and queryArgumentsJSONString for the raw serialized representations of the query arguments.

      Returns Readonly<any>

    • get queryArgumentsCBORData(): Uint8Array<ArrayBufferLike>

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

      Note that any Attachment values passed in as query arguments when creating this sync subscription will be represented by a serialized version of that attachment.

      Returns Uint8Array<ArrayBufferLike>

    • get queryArgumentsJSONString(): string

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

      Note that any Attachment values passed in as query arguments when creating this sync subscription will be represented by a serialized version of that attachment.

      Returns string

    • get queryString(): string

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

      Returns string

    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